2019-10-04 10:19:50

by Zheng Bin

[permalink] [raw]
Subject: [PATCH] rtw88: 8822c: Remove set but not used variable 'corr_val'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/realtek/rtw88/rtw8822c.c: In function rtw8822c_dpk_dc_corr_check:
drivers/net/wireless/realtek/rtw88/rtw8822c.c:2166:5: warning: variable corr_val set but not used [-Wunused-but-set-variable]

It is not used since commit 5227c2ee453d ("rtw88:
8822c: add SW DPK support")

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: zhengbin <[email protected]>
---
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
index a300efd..52682d5 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -2163,7 +2163,7 @@ static void rtw8822c_dpk_rxbb_dc_cal(struct rtw_dev *rtwdev, u8 path)
static u8 rtw8822c_dpk_dc_corr_check(struct rtw_dev *rtwdev, u8 path)
{
u16 dc_i, dc_q;
- u8 corr_val, corr_idx;
+ u8 corr_idx;

rtw_write32(rtwdev, REG_RXSRAM_CTL, 0x000900f0);
dc_i = (u16)rtw_read32_mask(rtwdev, REG_STAT_RPT, GENMASK(27, 16));
@@ -2176,7 +2176,6 @@ static u8 rtw8822c_dpk_dc_corr_check(struct rtw_dev *rtwdev, u8 path)

rtw_write32(rtwdev, REG_RXSRAM_CTL, 0x000000f0);
corr_idx = (u8)rtw_read32_mask(rtwdev, REG_STAT_RPT, GENMASK(7, 0));
- corr_val = (u8)rtw_read32_mask(rtwdev, REG_STAT_RPT, GENMASK(15, 8));

if (dc_i > 200 || dc_q > 200 || corr_idx < 40 || corr_idx > 65)
return 1;
--
2.7.4


2019-10-08 09:38:00

by Zheng Bin

[permalink] [raw]
Subject: Re: [PATCH] rtw88: 8822c: Remove set but not used variable 'corr_val'

Sorry for the noise, please ignore this

On 2019/10/4 17:18, zhengbin wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/wireless/realtek/rtw88/rtw8822c.c: In function rtw8822c_dpk_dc_corr_check:
> drivers/net/wireless/realtek/rtw88/rtw8822c.c:2166:5: warning: variable corr_val set but not used [-Wunused-but-set-variable]
>
> It is not used since commit 5227c2ee453d ("rtw88:
> 8822c: add SW DPK support")
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: zhengbin <[email protected]>
> ---
> drivers/net/wireless/realtek/rtw88/rtw8822c.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
> index a300efd..52682d5 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
> @@ -2163,7 +2163,7 @@ static void rtw8822c_dpk_rxbb_dc_cal(struct rtw_dev *rtwdev, u8 path)
> static u8 rtw8822c_dpk_dc_corr_check(struct rtw_dev *rtwdev, u8 path)
> {
> u16 dc_i, dc_q;
> - u8 corr_val, corr_idx;
> + u8 corr_idx;
>
> rtw_write32(rtwdev, REG_RXSRAM_CTL, 0x000900f0);
> dc_i = (u16)rtw_read32_mask(rtwdev, REG_STAT_RPT, GENMASK(27, 16));
> @@ -2176,7 +2176,6 @@ static u8 rtw8822c_dpk_dc_corr_check(struct rtw_dev *rtwdev, u8 path)
>
> rtw_write32(rtwdev, REG_RXSRAM_CTL, 0x000000f0);
> corr_idx = (u8)rtw_read32_mask(rtwdev, REG_STAT_RPT, GENMASK(7, 0));
> - corr_val = (u8)rtw_read32_mask(rtwdev, REG_STAT_RPT, GENMASK(15, 8));
>
> if (dc_i > 200 || dc_q > 200 || corr_idx < 40 || corr_idx > 65)
> return 1;
> --
> 2.7.4
>
>
> .
>

2019-10-08 14:26:04

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] rtw88: 8822c: Remove set but not used variable 'corr_val'

(PLEASE don't top post, fixing that manually)

"zhengbin (A)" <[email protected]> writes:

>
> On 2019/10/4 17:18, zhengbin wrote:
>> Fixes gcc '-Wunused-but-set-variable' warning:
>>
>> drivers/net/wireless/realtek/rtw88/rtw8822c.c: In function rtw8822c_dpk_dc_corr_check:
>> drivers/net/wireless/realtek/rtw88/rtw8822c.c:2166:5: warning: variable corr_val set but not used [-Wunused-but-set-variable]
>>
>> It is not used since commit 5227c2ee453d ("rtw88:
>> 8822c: add SW DPK support")
>>
>> Reported-by: Hulk Robot <[email protected]>
>> Signed-off-by: zhengbin <[email protected]>
>
> Sorry for the noise, please ignore this

Why? What was wrong in the patch?

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

2019-10-09 00:18:33

by Zheng Bin

[permalink] [raw]
Subject: Re: [PATCH] rtw88: 8822c: Remove set but not used variable 'corr_val'

On 2019/10/8 22:24, Kalle Valo wrote:

> (PLEASE don't top post, fixing that manually)
>
> "zhengbin (A)" <[email protected]> writes:
>
>> On 2019/10/4 17:18, zhengbin wrote:
>>> Fixes gcc '-Wunused-but-set-variable' warning:
>>>
>>> drivers/net/wireless/realtek/rtw88/rtw8822c.c: In function rtw8822c_dpk_dc_corr_check:
>>> drivers/net/wireless/realtek/rtw88/rtw8822c.c:2166:5: warning: variable corr_val set but not used [-Wunused-but-set-variable]
>>>
>>> It is not used since commit 5227c2ee453d ("rtw88:
>>> 8822c: add SW DPK support")
>>>
>>> Reported-by: Hulk Robot <[email protected]>
>>> Signed-off-by: zhengbin <[email protected]>
>> Sorry for the noise, please ignore this
> Why? What was wrong in the patch?

I am not sure whether we can just remove

corr_val = (u8)rtw_read32_mask(rtwdev, REG_STAT_RPT, GENMASK(15, 8))?

rtw_read32_mask

  rtw_read32

    ops->read32

 

Thank you for your remind of do not top post.

BTW:  patchset 'net/rtlwifi: remove some unused variables' & patch 'rtlwifi: rtl8192ee: Remove set but not used variable 'err''

are acked-by Ping-Ke Shih, can you help deal with it?

>