diff mbox series

[RESEND] wifi rtw89: coex: fix for variable set but not used warning

Message ID 20220912075418.1459127-1-sunliming@kylinos.cn (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series [RESEND] wifi rtw89: coex: fix for variable set but not used warning | expand

Commit Message

sunliming Sept. 12, 2022, 7:54 a.m. UTC
Fix below kernel warning:
drivers/net/wireless/realtek/rtw89/coex.c:3244:25: warning: variable 'cnt_connecting'
set but not used [-Wunused-but-set-variable]

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: sunliming <sunliming@kylinos.cn>
---
 drivers/net/wireless/realtek/rtw89/coex.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Ping-Ke Shih Sept. 12, 2022, 8:25 a.m. UTC | #1
> -----Original Message-----
> From: sunliming <sunliming@kylinos.cn>
> Sent: Monday, September 12, 2022 3:54 PM
> To: Ping-Ke Shih <pkshih@realtek.com>; kvalo@kernel.org; davem@davemloft.net; edumazet@google.com;
> kuba@kernel.org; pabeni@redhat.com
> Cc: linux-wireless@vger.kernel.org; netdev@vger.kernel.org; kelulanainsley@gmail.com; sunliming
> <sunliming@kylinos.cn>; kernel test robot <lkp@intel.com>
> Subject: [PATCH RESEND] wifi rtw89: coex: fix for variable set but not used warning
> 
> Fix below kernel warning:
> drivers/net/wireless/realtek/rtw89/coex.c:3244:25: warning: variable 'cnt_connecting'
> set but not used [-Wunused-but-set-variable]
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: sunliming <sunliming@kylinos.cn>

I have sent a patch to fix this: 
https://lore.kernel.org/linux-wireless/20220912021009.6011-1-pkshih@realtek.com/T/#u

So, NACK.

--
Ping-Ke
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c
index 683854bba217..ee4817358c35 100644
--- a/drivers/net/wireless/realtek/rtw89/coex.c
+++ b/drivers/net/wireless/realtek/rtw89/coex.c
@@ -3290,7 +3290,7 @@  static void _update_wl_info(struct rtw89_dev *rtwdev)
 	struct rtw89_btc_wl_link_info *wl_linfo = wl->link_info;
 	struct rtw89_btc_wl_role_info *wl_rinfo = &wl->role_info;
 	struct rtw89_btc_wl_dbcc_info *wl_dinfo = &wl->dbcc_info;
-	u8 i, cnt_connect = 0, cnt_connecting = 0, cnt_active = 0;
+	u8 i, cnt_connect = 0, cnt_active = 0;
 	u8 cnt_2g = 0, cnt_5g = 0, phy;
 	u32 wl_2g_ch[2] = {0}, wl_5g_ch[2] = {0};
 	bool b2g = false, b5g = false, client_joined = false;
@@ -3324,9 +3324,7 @@  static void _update_wl_info(struct rtw89_dev *rtwdev)
 
 		if (wl_linfo[i].connected == MLME_NO_LINK) {
 			continue;
-		} else if (wl_linfo[i].connected == MLME_LINKING) {
-			cnt_connecting++;
-		} else {
+		} else if (wl_linfo[i].connected != MLME_LINKING) {
 			cnt_connect++;
 			if ((wl_linfo[i].role == RTW89_WIFI_ROLE_P2P_GO ||
 			     wl_linfo[i].role == RTW89_WIFI_ROLE_AP) &&