1
0
Fork 0

rfkill: use variable instead of duplicating the expression

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>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
steinar/wifi_calib_4_9_kernel
João Paulo Rechi Vita 2016-01-19 10:42:37 -05:00 committed by Johannes Berg
parent 573a2b51ac
commit f3e7fae248
1 changed files with 1 additions and 1 deletions

View File

@ -287,7 +287,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;