diff options
author | João Paulo Rechi Vita <jprvita@gmail.com> | 2016-01-19 10:42:37 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-02-24 09:04:23 +0100 |
commit | f3e7fae248224b9441098e3c344b48b1cd1d9eca (patch) | |
tree | 8aad5c69e395c7b5917ead5f283208bb38840be1 | |
parent | 573a2b51acb48e745094cf3cb942cf6a55d2bf30 (diff) | |
download | op-kernel-dev-f3e7fae248224b9441098e3c344b48b1cd1d9eca.zip op-kernel-dev-f3e7fae248224b9441098e3c344b48b1cd1d9eca.tar.gz |
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>
-rw-r--r-- | net/rfkill/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 1664399..061ed37 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -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; |