mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 21:54:11 +08:00
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>
This commit is contained in:
parent
573a2b51ac
commit
f3e7fae248
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user