diff mbox series

[v2] rtlwifi: btcoex: fix if == else warning

Message ID 20220425031725.5808-1-guozhengkui@vivo.com (mailing list archive)
State Accepted
Commit 8c783024d6acbd7a18b94ae7ed0e0ed4f163d0ba
Delegated to: Kalle Valo
Headers show
Series [v2] rtlwifi: btcoex: fix if == else warning | expand

Commit Message

Guo Zhengkui April 25, 2022, 3:17 a.m. UTC
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(-)

Comments

Ping-Ke Shih April 25, 2022, 3:20 a.m. UTC | #1
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) ||
Kalle Valo April 27, 2022, 5:04 a.m. UTC | #2
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
diff mbox series

Patch

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) ||