diff mbox series

rtlwifi: Assign boolean values to a bool variable

Message ID 1611127628-50504-1-git-send-email-abaci-bugfix@linux.alibaba.com
State New
Headers show
Series rtlwifi: Assign boolean values to a bool variable | expand

Commit Message

Abaci Team Jan. 20, 2021, 7:27 a.m. UTC
Fix the following coccicheck warnings:

./drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:
892:1-10: WARNING: Assignment of 0/1 to bool variable.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
---
 drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sebastian Andrzej Siewior Jan. 20, 2021, 9:08 a.m. UTC | #1
On 2021-01-20 15:27:08 [+0800], Jiapeng Zhong wrote:
> diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> index be4c0e6..c198222 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> @@ -873,7 +873,7 @@ static void halbtc_display_wifi_status(struct btc_coexist *btcoexist,
>  	dc_mode = true;	/*TODO*/
>  	under_ips = rtlpriv->psc.inactive_pwrstate == ERFOFF ? 1 : 0;
>  	under_lps = rtlpriv->psc.dot11_psmode == EACTIVE ? 0 : 1;
> -	low_power = 0; /*TODO*/
> +	low_power = false; /*TODO*/

you could drop that assignment as it is already initialized to false at
the top.

>  	seq_printf(m, "\n %-35s = %s%s%s%s",
>  		   "Power Status",
>  		   (dc_mode ? "DC mode" : "AC mode"),

Sebastian
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
index be4c0e6..c198222 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
@@ -873,7 +873,7 @@  static void halbtc_display_wifi_status(struct btc_coexist *btcoexist,
 	dc_mode = true;	/*TODO*/
 	under_ips = rtlpriv->psc.inactive_pwrstate == ERFOFF ? 1 : 0;
 	under_lps = rtlpriv->psc.dot11_psmode == EACTIVE ? 0 : 1;
-	low_power = 0; /*TODO*/
+	low_power = false; /*TODO*/
 	seq_printf(m, "\n %-35s = %s%s%s%s",
 		   "Power Status",
 		   (dc_mode ? "DC mode" : "AC mode"),