projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
573a2b5
)
rfkill: use variable instead of duplicating the expression
author
João Paulo Rechi Vita
<jprvita@gmail.com>
Tue, 19 Jan 2016 15:42:37 +0000
(10:42 -0500)
committer
Johannes Berg
<johannes.berg@intel.com>
Wed, 24 Feb 2016 08:04:23 +0000
(09:04 +0100)
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>
net/rfkill/core.c
patch
|
blob
|
blame
|
history
diff --git
a/net/rfkill/core.c
b/net/rfkill/core.c
index 166439995f34d2cb3944f2475e02a6774abd0bdb..061ed37c07cfa04f800fcca18961857ddb80f445 100644
(file)
--- 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;