Skip to contentSkip to conversation

wifi: mac80211: remove unused has_5g variable

PATCH In review Tom Rix 3 participants 3 messages Mar 25, 2023 – Mar 31, 2023

Subsystems (3)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 wifi: mac80211: remove unused has_5g variable

clang with W=1 reports drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c:1051:6: error:
variable 'has_5g' set but not used [-Werror,-Wunused-but-set-variable]

        int has_5g = 0;
            ^

This variable is not used so remove it.

---
 drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c +0 -2
index a8333e6adbda..0bd4e679a359 100644
@@ -1048,7 +1048,6 @@ static int ieee_hw_rate_init(struct ieee80211_hw *hw)
 	struct brcms_info *wl = hw->priv;
 	struct brcms_c_info *wlc = wl->wlc;
 	struct ieee80211_supported_band *band;
-	int has_5g = 0;
 	u16 phy_type;
 
 	hw->wiphy->bands[NL80211_BAND_2GHZ] = NULL;
@@ -1070,7 +1069,6 @@ static int ieee_hw_rate_init(struct ieee80211_hw *hw)
 
 	/* Assume all bands use the same phy.  True for 11n devices. */
 	if (wl->pub->_nbands > 1) {
-		has_5g++;
 		if (phy_type == PHY_TYPE_N || phy_type == PHY_TYPE_LCN) {
 			band = &wlc->bandstate[BAND_5G_INDEX]->band;
 			*band = brcms_band_5GHz_nphy_template;
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Tom Rix

clang with W=1 reports drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c:1051:6: error:
variable 'has_5g' set but not used [-Werror,-Wunused-but-set-variable]

        int has_5g = 0;
            ^

This variable is not used so remove it.

#2 lore raw

Re: wifi: brcmsmac: remove unused has_5g variable

In reply to Tom Rix
Quoted 9 lines · Tom Rix

clang with W=1 reports drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c:1051:6: error:
variable 'has_5g' set but not used [-Werror,-Wunused-but-set-variable]

        int has_5g = 0;
            ^

This variable is not used so remove it.

Patch applied to wireless-next.git, thanks.

5aeb763a27c2 wifi: brcmsmac: remove unused has_5g variable

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

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