diff mbox series

[-next,3/9] rtlwifi: rtl8192cu: fix comparison to bool warning in mac.c

Message ID 20200918102505.16036-4-zhengbin13@huawei.com (mailing list archive)
State Accepted
Commit 03ce8159395159d46e549a6bcfc42fcdfa12307f
Delegated to: Kalle Valo
Headers show
Series rtlwifi: fix comparison to bool warnings | expand

Commit Message

Zheng Bin Sept. 18, 2020, 10:24 a.m. UTC
Fixes coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c:161:14-17: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c:168:13-16: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c:179:14-17: WARNING: Comparison to bool
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c:186:13-16: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--
2.26.0.106.g9fadedd

Comments

Larry Finger Sept. 18, 2020, 8:47 p.m. UTC | #1
On 9/18/20 5:24 AM, Zheng Bin wrote:
> Fixes coccicheck warning:
> 
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c:161:14-17: WARNING: Comparison to bool
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c:168:13-16: WARNING: Comparison to bool
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c:179:14-17: WARNING: Comparison to bool
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c:186:13-16: WARNING: Comparison to bool
> 
> Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
> ---
>   drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Larry

> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
> index d7afb6a186df..2890a495a23e 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
> @@ -158,14 +158,14 @@ bool rtl92c_init_llt_table(struct ieee80211_hw *hw, u32 boundary)
> 
>   	for (i = 0; i < (boundary - 1); i++) {
>   		rst = rtl92c_llt_write(hw, i , i + 1);
> -		if (true != rst) {
> +		if (!rst) {
>   			pr_err("===> %s #1 fail\n", __func__);
>   			return rst;
>   		}
>   	}
>   	/* end of list */
>   	rst = rtl92c_llt_write(hw, (boundary - 1), 0xFF);
> -	if (true != rst) {
> +	if (!rst) {
>   		pr_err("===> %s #2 fail\n", __func__);
>   		return rst;
>   	}
> @@ -176,14 +176,14 @@ bool rtl92c_init_llt_table(struct ieee80211_hw *hw, u32 boundary)
>   	 */
>   	for (i = boundary; i < LLT_LAST_ENTRY_OF_TX_PKT_BUFFER; i++) {
>   		rst = rtl92c_llt_write(hw, i, (i + 1));
> -		if (true != rst) {
> +		if (!rst) {
>   			pr_err("===> %s #3 fail\n", __func__);
>   			return rst;
>   		}
>   	}
>   	/* Let last entry point to the start entry of ring buffer */
>   	rst = rtl92c_llt_write(hw, LLT_LAST_ENTRY_OF_TX_PKT_BUFFER, boundary);
> -	if (true != rst) {
> +	if (!rst) {
>   		pr_err("===> %s #4 fail\n", __func__);
>   		return rst;
>   	}
> --
> 2.26.0.106.g9fadedd
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
index d7afb6a186df..2890a495a23e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
@@ -158,14 +158,14 @@  bool rtl92c_init_llt_table(struct ieee80211_hw *hw, u32 boundary)

 	for (i = 0; i < (boundary - 1); i++) {
 		rst = rtl92c_llt_write(hw, i , i + 1);
-		if (true != rst) {
+		if (!rst) {
 			pr_err("===> %s #1 fail\n", __func__);
 			return rst;
 		}
 	}
 	/* end of list */
 	rst = rtl92c_llt_write(hw, (boundary - 1), 0xFF);
-	if (true != rst) {
+	if (!rst) {
 		pr_err("===> %s #2 fail\n", __func__);
 		return rst;
 	}
@@ -176,14 +176,14 @@  bool rtl92c_init_llt_table(struct ieee80211_hw *hw, u32 boundary)
 	 */
 	for (i = boundary; i < LLT_LAST_ENTRY_OF_TX_PKT_BUFFER; i++) {
 		rst = rtl92c_llt_write(hw, i, (i + 1));
-		if (true != rst) {
+		if (!rst) {
 			pr_err("===> %s #3 fail\n", __func__);
 			return rst;
 		}
 	}
 	/* Let last entry point to the start entry of ring buffer */
 	rst = rtl92c_llt_write(hw, LLT_LAST_ENTRY_OF_TX_PKT_BUFFER, boundary);
-	if (true != rst) {
+	if (!rst) {
 		pr_err("===> %s #4 fail\n", __func__);
 		return rst;
 	}