rtlwifi: remove comparison of 0/1 to bool variable
authorJason Yan <yanaijie@huawei.com>
Wed, 29 Apr 2020 14:09:24 +0000 (22:09 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 6 May 2020 08:42:46 +0000 (11:42 +0300)
The variable 'rtlpriv->rfkill.rfkill_state' is bool and can directly
assigned to bool values.

Fix the following coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/core.c:1725:14-42: WARNING:
Comparison of 0/1 to bool variable

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200429140924.7750-1-yanaijie@huawei.com
drivers/net/wireless/realtek/rtlwifi/core.c

index f73e690bbe8e0b5cf11728b3310cdec03aaf68ed..4dd82c6052f0f5c2dd1aaf8ba6fd1d0b5236520d 100644 (file)
@@ -1722,7 +1722,7 @@ static void rtl_op_rfkill_poll(struct ieee80211_hw *hw)
                                 "wireless radio switch turned %s\n",
                                  radio_state ? "on" : "off");
 
-                       blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1;
+                       blocked = !rtlpriv->rfkill.rfkill_state;
                        wiphy_rfkill_set_hw_state(hw->wiphy, blocked);
                }
        }