All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtlwifi: btcoex: fix if == else warning
@ 2022-04-24  7:55 Guo Zhengkui
  2022-04-25  0:04 ` Pkshih
  0 siblings, 1 reply; 5+ messages in thread
From: Guo Zhengkui @ 2022-04-24  7:55 UTC (permalink / raw)
  To: Ping-Ke Shih, Kalle Valo, David S. Miller, Jakub Kicinski,
	Paolo Abeni, Guo Zhengkui,
	open list:REALTEK WIRELESS DRIVER (rtlwifi family),
	open list:NETWORKING DRIVERS, open list
  Cc: zhengkui_guo

Fix the following coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c:1604:2-4:
WARNING: possible condition with no effect (if == else).

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
---
 .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.c   | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
index a18dffc8753a..2f4c6a37a2e8 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
@@ -1601,17 +1601,10 @@ static void btc8821a1ant_act_wifi_con_bt_acl_busy(struct btc_coexist *btcoexist,
 		}
 	} else if (bt_link_info->hid_exist && bt_link_info->a2dp_exist) {
 		/* HID+A2DP */
-		if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
-		    (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
-			btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
-					     true, 14);
-			coex_dm->auto_tdma_adjust = false;
-		} else {
-			/*for low BT RSSI*/
-			btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
-					     true, 14);
-			coex_dm->auto_tdma_adjust = false;
-		}
+		/* for low BT RSSI */
+		btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
+				     true, 14);
+		coex_dm->auto_tdma_adjust = false;
 
 		btc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 1);
 	} else if ((bt_link_info->pan_only) ||
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] rtlwifi: btcoex: fix if == else warning
  2022-04-24  7:55 [PATCH] rtlwifi: btcoex: fix if == else warning Guo Zhengkui
@ 2022-04-25  0:04 ` Pkshih
  2022-04-25  3:17   ` [PATCH v2] " Guo Zhengkui
  0 siblings, 1 reply; 5+ messages in thread
From: Pkshih @ 2022-04-25  0:04 UTC (permalink / raw)
  To: davem, kvalo, guozhengkui, linux-kernel, linux-wireless, pabeni,
	netdev, kuba
  Cc: zhengkui_guo

On Sun, 2022-04-24 at 15:55 +0800, Guo Zhengkui wrote:
> Fix the following coccicheck warning:
> 
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c:1604:2-4:
> WARNING: possible condition with no effect (if == else).
> 
> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
> ---
>  .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.c   | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
> b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
> index a18dffc8753a..2f4c6a37a2e8 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
> @@ -1601,17 +1601,10 @@ static void btc8821a1ant_act_wifi_con_bt_acl_busy(struct btc_coexist
> *btcoexist,
>  		}
>  	} else if (bt_link_info->hid_exist && bt_link_info->a2dp_exist) {
>  		/* HID+A2DP */
> -		if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
> -		    (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
> -			btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
> -					     true, 14);
> -			coex_dm->auto_tdma_adjust = false;
> -		} else {
> -			/*for low BT RSSI*/
> -			btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
> -					     true, 14);
> -			coex_dm->auto_tdma_adjust = false;
> -		}
> +		/* for low BT RSSI */

The comment shuold be removed, or "No need to consider BT RSSI".

> +		btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
> +				     true, 14);
> +		coex_dm->auto_tdma_adjust = false;
>  
>  		btc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 1);
>  	} else if ((bt_link_info->pan_only) ||
> 

The code is to preserve a room to fine tune BT coexistence to get
better user experience for certain cases. Since it works well,
I think they can be removed now.

--
Ping-Ke


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] rtlwifi: btcoex: fix if == else warning
  2022-04-25  0:04 ` Pkshih
@ 2022-04-25  3:17   ` Guo Zhengkui
  2022-04-25  3:20     ` Pkshih
  2022-04-27  5:04     ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Guo Zhengkui @ 2022-04-25  3:17 UTC (permalink / raw)
  To: Ping-Ke Shih, Kalle Valo, David S. Miller, Jakub Kicinski,
	Paolo Abeni, Guo Zhengkui,
	open list:REALTEK WIRELESS DRIVER (rtlwifi family),
	open list:NETWORKING DRIVERS, open list
  Cc: zhengkui_guo

Fix the following coccicheck warning:

drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c:1604:2-4:
WARNING: possible condition with no effect (if == else).

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
---
v1 -> v2: Modify the comment according to Ping-Ke's suggestion.

 .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.c  | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
index a18dffc8753a..67d0b9aee064 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
@@ -1600,18 +1600,10 @@ static void btc8821a1ant_act_wifi_con_bt_acl_busy(struct btc_coexist *btcoexist,
 			coex_dm->auto_tdma_adjust = false;
 		}
 	} else if (bt_link_info->hid_exist && bt_link_info->a2dp_exist) {
-		/* HID+A2DP */
-		if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
-		    (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
-			btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
-					     true, 14);
-			coex_dm->auto_tdma_adjust = false;
-		} else {
-			/*for low BT RSSI*/
-			btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
-					     true, 14);
-			coex_dm->auto_tdma_adjust = false;
-		}
+		/* HID+A2DP (no need to consider BT RSSI) */
+		btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
+				     true, 14);
+		coex_dm->auto_tdma_adjust = false;
 
 		btc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 1);
 	} else if ((bt_link_info->pan_only) ||
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] rtlwifi: btcoex: fix if == else warning
  2022-04-25  3:17   ` [PATCH v2] " Guo Zhengkui
@ 2022-04-25  3:20     ` Pkshih
  2022-04-27  5:04     ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Pkshih @ 2022-04-25  3:20 UTC (permalink / raw)
  To: davem, kvalo, guozhengkui, linux-kernel, linux-wireless, pabeni,
	netdev, kuba
  Cc: zhengkui_guo

On Mon, 2022-04-25 at 11:17 +0800, Guo Zhengkui wrote:
> Fix the following coccicheck warning:
> 
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c:1604:2-4:
> WARNING: possible condition with no effect (if == else).
> 
> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Thank you

> ---
> v1 -> v2: Modify the comment according to Ping-Ke's suggestion.
> 
>  .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.c  | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
> b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
> index a18dffc8753a..67d0b9aee064 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
> @@ -1600,18 +1600,10 @@ static void btc8821a1ant_act_wifi_con_bt_acl_busy(struct btc_coexist
> *btcoexist,
>  			coex_dm->auto_tdma_adjust = false;
>  		}
>  	} else if (bt_link_info->hid_exist && bt_link_info->a2dp_exist) {
> -		/* HID+A2DP */
> -		if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
> -		    (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
> -			btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
> -					     true, 14);
> -			coex_dm->auto_tdma_adjust = false;
> -		} else {
> -			/*for low BT RSSI*/
> -			btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
> -					     true, 14);
> -			coex_dm->auto_tdma_adjust = false;
> -		}
> +		/* HID+A2DP (no need to consider BT RSSI) */
> +		btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
> +				     true, 14);
> +		coex_dm->auto_tdma_adjust = false;
>  
>  		btc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 1);
>  	} else if ((bt_link_info->pan_only) ||



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] rtlwifi: btcoex: fix if == else warning
  2022-04-25  3:17   ` [PATCH v2] " Guo Zhengkui
  2022-04-25  3:20     ` Pkshih
@ 2022-04-27  5:04     ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2022-04-27  5:04 UTC (permalink / raw)
  To: Guo Zhengkui
  Cc: Ping-Ke Shih, David S. Miller, Jakub Kicinski, Paolo Abeni,
	Guo Zhengkui, open list:REALTEK WIRELESS DRIVER (rtlwifi family),
	open list:NETWORKING DRIVERS, open list, zhengkui_guo

Guo Zhengkui <guozhengkui@vivo.com> wrote:

> Fix the following coccicheck warning:
> 
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c:1604:2-4:
> WARNING: possible condition with no effect (if == else).
> 
> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless-next.git, thanks.

8c783024d6ac rtlwifi: btcoex: fix if == else warning

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20220425031725.5808-1-guozhengkui@vivo.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-27  5:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24  7:55 [PATCH] rtlwifi: btcoex: fix if == else warning Guo Zhengkui
2022-04-25  0:04 ` Pkshih
2022-04-25  3:17   ` [PATCH v2] " Guo Zhengkui
2022-04-25  3:20     ` Pkshih
2022-04-27  5:04     ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.