diff mbox

[2/8] rfkill: Improve code readability

Message ID 1453218163-31998-3-git-send-email-jprvita@endlessm.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

=?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= Jan. 19, 2016, 3:42 p.m. UTC
RFKILL_BLOCK_SW value have just been saved to prev, no need to check it
again in the if expression. This makes code a little bit easier to read.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
---
 net/rfkill/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 4d6d726..838e869 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -285,7 +285,7 @@  static void rfkill_set_block(struct rfkill *rfkill, bool blocked)
 	spin_lock_irqsave(&rfkill->lock, flags);
 	prev = rfkill->state & RFKILL_BLOCK_SW;
 
-	if (rfkill->state & RFKILL_BLOCK_SW)
+	if (prev)
 		rfkill->state |= RFKILL_BLOCK_SW_PREV;
 	else
 		rfkill->state &= ~RFKILL_BLOCK_SW_PREV;