2019-09-30 08:49:02

by Zheng Bin

[permalink] [raw]
Subject: [PATCH 1/6] rtlwifi: Remove set but not used variable 'rtstate'

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

drivers/net/wireless/realtek/rtlwifi/ps.c: In function rtl_ps_set_rf_state:
drivers/net/wireless/realtek/rtlwifi/ps.c:71:19: warning: variable rtstate set but not used [-Wunused-but-set-variable]

It is not used since commit f1d2b4d338bf ("rtlwifi:
rtl818x: Move drivers into new realtek directory")

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

diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c
index 70f04c2..e13913a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/ps.c
+++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
@@ -68,7 +68,6 @@ static bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
- enum rf_pwrstate rtstate;
bool actionallowed = false;
u16 rfwait_cnt = 0;

@@ -102,8 +101,6 @@ static bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
}
}

- rtstate = ppsc->rfpwr_state;
-
switch (state_toset) {
case ERFON:
ppsc->rfoff_reason &= (~changesource);
--
2.7.4


2019-10-02 06:40:40

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 1/6] rtlwifi: Remove set but not used variable 'rtstate'

zhengbin <[email protected]> wrote:

> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/wireless/realtek/rtlwifi/ps.c: In function rtl_ps_set_rf_state:
> drivers/net/wireless/realtek/rtlwifi/ps.c:71:19: warning: variable rtstate set but not used [-Wunused-but-set-variable]
>
> It is not used since commit f1d2b4d338bf ("rtlwifi:
> rtl818x: Move drivers into new realtek directory")
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: zhengbin <[email protected]>

5 patches applied to wireless-drivers-next.git, thanks.

4010758eb082 rtlwifi: Remove set but not used variable 'rtstate'
70906d941ccd rtlwifi: Remove set but not used variables 'dataempty','hoffset'
4a26e11500b8 rtlwifi: rtl8192ee: Remove set but not used variables 'short_gi','buf_len'
533e3de41205 rtlwifi: rtl8192ee: Remove set but not used variables 'reg_ecc','reg_eac'
66070e86878c rtlwifi: rtl8723be: Remove set but not used variables 'reg_ecc','reg_eac'

--
https://patchwork.kernel.org/patch/11166203/

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