* [PATCH -next] staging: rtlwifi: rtl8822be: Remove set but not used variable 'curtxbw_40mhz'
@ 2019-04-06 3:11 YueHaibing
2019-04-06 8:19 ` Mukesh Ojha
0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2019-04-06 3:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Ping-Ke Shih, Nathan Chancellor, Nishka Dasgupta
Cc: YueHaibing, devel, linux-kernel, kernel-janitors
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/staging/rtlwifi/rtl8822be/hw.c: In function 'rtl8822be_update_hal_rate_mask':
drivers/staging/rtlwifi/rtl8822be/hw.c:2144:5: warning:
variable 'curtxbw_40mhz' set but not used [-Wunused-but-set-variable]
It's never used and can be removed.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/staging/rtlwifi/rtl8822be/hw.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/rtlwifi/rtl8822be/hw.c b/drivers/staging/rtlwifi/rtl8822be/hw.c
index dac22c21f821..1de4e903a4de 100644
--- a/drivers/staging/rtlwifi/rtl8822be/hw.c
+++ b/drivers/staging/rtlwifi/rtl8822be/hw.c
@@ -2141,8 +2141,6 @@ static void rtl8822be_update_hal_rate_mask(struct ieee80211_hw *hw,
u32 ratr_bitmap, ratr_bitmap_msb = 0;
u8 ratr_index;
enum wireless_mode wirelessmode = 0;
- u8 curtxbw_40mhz =
- (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1 : 0;
bool b_shortgi = false;
u8 rate_mask[7];
u8 macid = 0;
@@ -2153,11 +2151,8 @@ static void rtl8822be_update_hal_rate_mask(struct ieee80211_hw *hw,
RT_TRACE(rtlpriv, COMP_RATR, DBG_LOUD, "wireless mode = 0x%x\n",
wirelessmode);
- if (mac->opmode == NL80211_IFTYPE_STATION ||
- mac->opmode == NL80211_IFTYPE_MESH_POINT) {
- curtxbw_40mhz = mac->bw_40;
- } else if (mac->opmode == NL80211_IFTYPE_AP ||
- mac->opmode == NL80211_IFTYPE_ADHOC)
+ if (mac->opmode == NL80211_IFTYPE_AP ||
+ mac->opmode == NL80211_IFTYPE_ADHOC)
macid = sta->aid + 1;
if (wirelessmode == WIRELESS_MODE_N_5G ||
wirelessmode == WIRELESS_MODE_AC_5G ||
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] staging: rtlwifi: rtl8822be: Remove set but not used variable 'curtxbw_40mhz'
2019-04-06 3:11 [PATCH -next] staging: rtlwifi: rtl8822be: Remove set but not used variable 'curtxbw_40mhz' YueHaibing
@ 2019-04-06 8:19 ` Mukesh Ojha
0 siblings, 0 replies; 2+ messages in thread
From: Mukesh Ojha @ 2019-04-06 8:19 UTC (permalink / raw)
To: YueHaibing, Greg Kroah-Hartman, Ping-Ke Shih, Nathan Chancellor,
Nishka Dasgupta
Cc: devel, linux-kernel, kernel-janitors
On 4/6/2019 8:41 AM, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/staging/rtlwifi/rtl8822be/hw.c: In function 'rtl8822be_update_hal_rate_mask':
> drivers/staging/rtlwifi/rtl8822be/hw.c:2144:5: warning:
> variable 'curtxbw_40mhz' set but not used [-Wunused-but-set-variable]
>
> It's never used and can be removed.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Cheers,
-Mukesh
> ---
> drivers/staging/rtlwifi/rtl8822be/hw.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/rtlwifi/rtl8822be/hw.c b/drivers/staging/rtlwifi/rtl8822be/hw.c
> index dac22c21f821..1de4e903a4de 100644
> --- a/drivers/staging/rtlwifi/rtl8822be/hw.c
> +++ b/drivers/staging/rtlwifi/rtl8822be/hw.c
> @@ -2141,8 +2141,6 @@ static void rtl8822be_update_hal_rate_mask(struct ieee80211_hw *hw,
> u32 ratr_bitmap, ratr_bitmap_msb = 0;
> u8 ratr_index;
> enum wireless_mode wirelessmode = 0;
> - u8 curtxbw_40mhz =
> - (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1 : 0;
> bool b_shortgi = false;
> u8 rate_mask[7];
> u8 macid = 0;
> @@ -2153,11 +2151,8 @@ static void rtl8822be_update_hal_rate_mask(struct ieee80211_hw *hw,
>
> RT_TRACE(rtlpriv, COMP_RATR, DBG_LOUD, "wireless mode = 0x%x\n",
> wirelessmode);
> - if (mac->opmode == NL80211_IFTYPE_STATION ||
> - mac->opmode == NL80211_IFTYPE_MESH_POINT) {
> - curtxbw_40mhz = mac->bw_40;
> - } else if (mac->opmode == NL80211_IFTYPE_AP ||
> - mac->opmode == NL80211_IFTYPE_ADHOC)
> + if (mac->opmode == NL80211_IFTYPE_AP ||
> + mac->opmode == NL80211_IFTYPE_ADHOC)
> macid = sta->aid + 1;
> if (wirelessmode == WIRELESS_MODE_N_5G ||
> wirelessmode == WIRELESS_MODE_AC_5G ||
>
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-06 8:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-06 3:11 [PATCH -next] staging: rtlwifi: rtl8822be: Remove set but not used variable 'curtxbw_40mhz' YueHaibing
2019-04-06 8:19 ` Mukesh Ojha
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).