From: João Paulo Rechi Vita Date: Tue, 19 Jan 2016 15:42:37 +0000 (-0500) Subject: rfkill: use variable instead of duplicating the expression X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f3e7fae248224b9441098e3c344b48b1cd1d9eca;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Johannes Berg --- diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 166439995f34..061ed37c07cf 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;