* [PATCH] rtlwifi: use true,false for bool variable in rtl_init_rfkill()
@ 2020-04-26 9:41 Jason Yan
2020-05-06 8:32 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Jason Yan @ 2020-04-26 9:41 UTC (permalink / raw)
To: pkshih, kvalo, davem, linux-wireless, netdev, linux-kernel; +Cc: Jason Yan
The 'blocked' is a bool variable, and '==' expression itself is bool
too. So no need to convert it to 0/1.
This fixes the following coccicheck warning:
drivers/net/wireless/realtek/rtlwifi/base.c:508:13-41: WARNING:
Comparison of 0/1 to bool variable
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
drivers/net/wireless/realtek/rtlwifi/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
index c75192c4447f..a4489b9302d4 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -505,7 +505,7 @@ void rtl_init_rfkill(struct ieee80211_hw *hw)
rtlpriv->rfkill.rfkill_state = radio_state;
- blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1;
+ blocked = rtlpriv->rfkill.rfkill_state != 1;
wiphy_rfkill_set_hw_state(hw->wiphy, blocked);
}
--
2.21.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rtlwifi: use true,false for bool variable in rtl_init_rfkill()
2020-04-26 9:41 [PATCH] rtlwifi: use true,false for bool variable in rtl_init_rfkill() Jason Yan
@ 2020-05-06 8:32 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2020-05-06 8:32 UTC (permalink / raw)
To: Jason Yan; +Cc: pkshih, davem, linux-wireless, netdev, linux-kernel, Jason Yan
Jason Yan <yanaijie@huawei.com> wrote:
> The 'blocked' is a bool variable, and '==' expression itself is bool
> too. So no need to convert it to 0/1.
>
> This fixes the following coccicheck warning:
>
> drivers/net/wireless/realtek/rtlwifi/base.c:508:13-41: WARNING:
> Comparison of 0/1 to bool variable
>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
Patch applied to wireless-drivers-next.git, thanks.
fb1a9fc550cf rtlwifi: use true,false for bool variable in rtl_init_rfkill()
--
https://patchwork.kernel.org/patch/11510335/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-06 8:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-26 9:41 [PATCH] rtlwifi: use true,false for bool variable in rtl_init_rfkill() Jason Yan
2020-05-06 8:32 ` Kalle Valo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.