rtlwifi: rtl8723ae: fix warning comparison to bool
authorJason Yan <yanaijie@huawei.com>
Mon, 20 Apr 2020 04:26:58 +0000 (12:26 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 21 Apr 2020 12:58:36 +0000 (15:58 +0300)
Fix the following coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c:617:14-20: WARNING:
Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c:622:13-19: WARNING:
Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c:627:14-20: WARNING:
Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c:632:13-19: WARNING:
Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c:937:5-13: WARNING:
Comparison to bool

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

index 655460f..7a46c6a 100644 (file)
@@ -614,22 +614,22 @@ static bool _rtl8723e_llt_table_init(struct ieee80211_hw *hw)
 
        for (i = 0; i < (txpktbuf_bndy - 1); i++) {
                status = _rtl8723e_llt_write(hw, i, i + 1);
-               if (true != status)
+               if (!status)
                        return status;
        }
 
        status = _rtl8723e_llt_write(hw, (txpktbuf_bndy - 1), 0xFF);
-       if (true != status)
+       if (!status)
                return status;
 
        for (i = txpktbuf_bndy; i < maxpage; i++) {
                status = _rtl8723e_llt_write(hw, i, (i + 1));
-               if (true != status)
+               if (!status)
                        return status;
        }
 
        status = _rtl8723e_llt_write(hw, maxpage, txpktbuf_bndy);
-       if (true != status)
+       if (!status)
                return status;
 
        rtl_write_byte(rtlpriv, REG_CR, 0xff);
@@ -934,7 +934,7 @@ int rtl8723e_hw_init(struct ieee80211_hw *hw)
 
        rtlpriv->intf_ops->disable_aspm(hw);
        rtstatus = _rtl8712e_init_mac(hw);
-       if (rtstatus != true) {
+       if (!rtstatus) {
                pr_err("Init MAC failed\n");
                err = 1;
                goto exit;