Commit f3e7fae2 authored by João Paulo Rechi Vita's avatar João Paulo Rechi Vita Committed by Johannes Berg

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: default avatarJoão Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 573a2b51
...@@ -287,7 +287,7 @@ static void rfkill_set_block(struct rfkill *rfkill, bool blocked) ...@@ -287,7 +287,7 @@ static void rfkill_set_block(struct rfkill *rfkill, bool blocked)
spin_lock_irqsave(&rfkill->lock, flags); spin_lock_irqsave(&rfkill->lock, flags);
prev = rfkill->state & RFKILL_BLOCK_SW; prev = rfkill->state & RFKILL_BLOCK_SW;
if (rfkill->state & RFKILL_BLOCK_SW) if (prev)
rfkill->state |= RFKILL_BLOCK_SW_PREV; rfkill->state |= RFKILL_BLOCK_SW_PREV;
else else
rfkill->state &= ~RFKILL_BLOCK_SW_PREV; rfkill->state &= ~RFKILL_BLOCK_SW_PREV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment