linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtw88: coex: remove the unreached code in rtw_coex_set_tdma
@ 2020-11-14 15:22 xiakaixu1987
  2020-11-17  8:12 ` Pkshih
  0 siblings, 1 reply; 3+ messages in thread
From: xiakaixu1987 @ 2020-11-14 15:22 UTC (permalink / raw)
  To: yhchuang, kvalo; +Cc: linux-wireless, linux-kernel, Kaixu Xia

From: Kaixu Xia <kaixuxia@tencent.com>

The value of the bool variable ap_enable is always false, so the first
if branch is unreached code. Remove it.

Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
 drivers/net/wireless/realtek/rtw88/coex.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/coex.c b/drivers/net/wireless/realtek/rtw88/coex.c
index aa08fd7d9fcd..9c7963e45755 100644
--- a/drivers/net/wireless/realtek/rtw88/coex.c
+++ b/drivers/net/wireless/realtek/rtw88/coex.c
@@ -863,18 +863,8 @@ static void rtw_coex_set_tdma(struct rtw_dev *rtwdev, u8 byte1, u8 byte2,
 	struct rtw_coex_dm *coex_dm = &coex->dm;
 	struct rtw_chip_info *chip = rtwdev->chip;
 	u8 ps_type = COEX_PS_WIFI_NATIVE;
-	bool ap_enable = false;
-
-	if (ap_enable && (byte1 & BIT(4) && !(byte1 & BIT(5)))) {
-		byte1 &= ~BIT(4);
-		byte1 |= BIT(5);
-
-		byte5 |= BIT(5);
-		byte5 &= ~BIT(6);
 
-		ps_type = COEX_PS_WIFI_NATIVE;
-		rtw_coex_power_save_state(rtwdev, ps_type, 0x0, 0x0);
-	} else if (byte1 & BIT(4) && !(byte1 & BIT(5))) {
+	if (byte1 & BIT(4) && !(byte1 & BIT(5))) {
 		if (chip->pstdma_type == COEX_PSTDMA_FORCE_LPSOFF)
 			ps_type = COEX_PS_LPS_OFF;
 		else
-- 
2.20.0


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

* Re: [PATCH] rtw88: coex: remove the unreached code in rtw_coex_set_tdma
  2020-11-14 15:22 [PATCH] rtw88: coex: remove the unreached code in rtw_coex_set_tdma xiakaixu1987
@ 2020-11-17  8:12 ` Pkshih
  2020-11-17  8:21   ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Pkshih @ 2020-11-17  8:12 UTC (permalink / raw)
  To: Tony Chuang, kvalo, xiakaixu1987; +Cc: linux-wireless, linux-kernel, kaixuxia

On Sat, 2020-11-14 at 15:22 +0000, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
> 
> The value of the bool variable ap_enable is always false, so the first
> if branch is unreached code. Remove it.
> 
> Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
> ---
>  drivers/net/wireless/realtek/rtw88/coex.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/coex.c
> b/drivers/net/wireless/realtek/rtw88/coex.c
> index aa08fd7d9fcd..9c7963e45755 100644
> --- a/drivers/net/wireless/realtek/rtw88/coex.c
> +++ b/drivers/net/wireless/realtek/rtw88/coex.c
> @@ -863,18 +863,8 @@ static void rtw_coex_set_tdma(struct rtw_dev *rtwdev, u8
> byte1, u8 byte2,
>  	struct rtw_coex_dm *coex_dm = &coex->dm;
>  	struct rtw_chip_info *chip = rtwdev->chip;
>  	u8 ps_type = COEX_PS_WIFI_NATIVE;
> -	bool ap_enable = false;

The variable 'ap_enable' is used to indicate a vif is running in AP mode.
At the first coex version, rtw88 doesn't support AP mode yet, so ap_enable
is set to false. For now, AP mode is ready, and I can send a patch to set
proper value depends on vif mode.

Since I'm submitting coex patches to upgrade the code. In order to avoid
conflicting, I'll send the patch to set proper ap_enable after all my patches
are merged.


> -
> -	if (ap_enable && (byte1 & BIT(4) && !(byte1 & BIT(5)))) {
> -		byte1 &= ~BIT(4);
> -		byte1 |= BIT(5);
> -
> -		byte5 |= BIT(5);
> -		byte5 &= ~BIT(6);
>  
> -		ps_type = COEX_PS_WIFI_NATIVE;
> -		rtw_coex_power_save_state(rtwdev, ps_type, 0x0, 0x0);
> -	} else if (byte1 & BIT(4) && !(byte1 & BIT(5))) {
> +	if (byte1 & BIT(4) && !(byte1 & BIT(5))) {
>  		if (chip->pstdma_type == COEX_PSTDMA_FORCE_LPSOFF)
>  			ps_type = COEX_PS_LPS_OFF;
>  		else
> -- 
> 2.20.0
> 

---
Ping-Ke


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

* Re: [PATCH] rtw88: coex: remove the unreached code in rtw_coex_set_tdma
  2020-11-17  8:12 ` Pkshih
@ 2020-11-17  8:21   ` Kalle Valo
  0 siblings, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2020-11-17  8:21 UTC (permalink / raw)
  To: Pkshih; +Cc: Tony Chuang, xiakaixu1987, linux-wireless, linux-kernel, kaixuxia

Pkshih <pkshih@realtek.com> writes:

> On Sat, 2020-11-14 at 15:22 +0000, xiakaixu1987@gmail.com wrote:
>> From: Kaixu Xia <kaixuxia@tencent.com>
>> 
>> The value of the bool variable ap_enable is always false, so the first
>> if branch is unreached code. Remove it.
>> 
>> Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
>> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
>> ---
>>  drivers/net/wireless/realtek/rtw88/coex.c | 12 +-----------
>>  1 file changed, 1 insertion(+), 11 deletions(-)
>> 
>> diff --git a/drivers/net/wireless/realtek/rtw88/coex.c
>> b/drivers/net/wireless/realtek/rtw88/coex.c
>> index aa08fd7d9fcd..9c7963e45755 100644
>> --- a/drivers/net/wireless/realtek/rtw88/coex.c
>> +++ b/drivers/net/wireless/realtek/rtw88/coex.c
>> @@ -863,18 +863,8 @@ static void rtw_coex_set_tdma(struct rtw_dev *rtwdev, u8
>> byte1, u8 byte2,
>>  	struct rtw_coex_dm *coex_dm = &coex->dm;
>>  	struct rtw_chip_info *chip = rtwdev->chip;
>>  	u8 ps_type = COEX_PS_WIFI_NATIVE;
>> -	bool ap_enable = false;
>
> The variable 'ap_enable' is used to indicate a vif is running in AP mode.
> At the first coex version, rtw88 doesn't support AP mode yet, so ap_enable
> is set to false. For now, AP mode is ready, and I can send a patch to set
> proper value depends on vif mode.
>
> Since I'm submitting coex patches to upgrade the code. In order to avoid
> conflicting, I'll send the patch to set proper ap_enable after all my patches
> are merged.

Ok, I'll then drop this.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

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

end of thread, other threads:[~2020-11-17  8:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-14 15:22 [PATCH] rtw88: coex: remove the unreached code in rtw_coex_set_tdma xiakaixu1987
2020-11-17  8:12 ` Pkshih
2020-11-17  8:21   ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).