diff mbox series

rtw88: 8822c: fix boolreturn.cocci warnings

Message ID 1568601700-12162-1-git-send-email-yhchuang@realtek.com (mailing list archive)
State Accepted
Commit 0d32f5d93bbaeb57b607cb5cb1c67626d5754905
Delegated to: Kalle Valo
Headers show
Series rtw88: 8822c: fix boolreturn.cocci warnings | expand

Commit Message

Tony Chuang Sept. 16, 2019, 2:41 a.m. UTC
From: Yan-Hsuan Chuang <yhchuang@realtek.com>

drivers/net/wireless/realtek/rtw88/rtw8822c.c:2606:9-10: WARNING: return
of 0/1 in function 'rtw8822c_dpk_coef_iq_check' with return type bool

Return statements in functions returning bool should use true/false
instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.cocci

Fixes: 5227c2ee453d ("rtw88: 8822c: add SW DPK support")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/rtw8822c.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Kalle Valo Oct. 1, 2019, 9:18 a.m. UTC | #1
<yhchuang@realtek.com> wrote:

> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> 
> drivers/net/wireless/realtek/rtw88/rtw8822c.c:2606:9-10: WARNING: return
> of 0/1 in function 'rtw8822c_dpk_coef_iq_check' with return type bool
> 
> Return statements in functions returning bool should use true/false
> instead of 1/0.
> Generated by: scripts/coccinelle/misc/boolreturn.cocci
> 
> Fixes: 5227c2ee453d ("rtw88: 8822c: add SW DPK support")
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>

Patch applied to wireless-drivers-next.git, thanks.

0d32f5d93bba rtw88: 8822c: fix boolreturn.cocci warnings
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
index c2f6cd7..084c18d 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -2603,9 +2603,9 @@  static bool rtw8822c_dpk_coef_iq_check(struct rtw_dev *rtwdev,
 {
 	if (coef_i == 0x1000 || coef_i == 0x0fff ||
 	    coef_q == 0x1000 || coef_q == 0x0fff)
-		return 1;
-	else
-		return 0;
+		return true;
+
+	return false;
 }
 
 static u32 rtw8822c_dpk_coef_transfer(struct rtw_dev *rtwdev)