lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0355f52ad7bf46454af4d5cb28fd6d59f678c25f.camel@realtek.com>
Date:   Mon, 25 Apr 2022 00:04:04 +0000
From:   Pkshih <pkshih@...ltek.com>
To:     "davem@...emloft.net" <davem@...emloft.net>,
        "kvalo@...nel.org" <kvalo@...nel.org>,
        "guozhengkui@...o.com" <guozhengkui@...o.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "kuba@...nel.org" <kuba@...nel.org>
CC:     "zhengkui_guo@...look.com" <zhengkui_guo@...look.com>
Subject: Re: [PATCH] rtlwifi: btcoex: fix if == else warning

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@...o.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ