Skip to contentSkip to conversation

ath6kl: remove redundant variable ies_len

PATCH In review Kenneth Lu 3 participants 3 messages Nov 26, 2017 – Dec 7, 2017 Atheros ATH6KL wireless driver

lore
Share & tools
lore

Kenneth Lu

author
#0 lore raw

PATCH 1/1 ath6kl: remove redundant variable ies_len

To get rid of W=1 warning: variable ‘ies_len’ set but not used. Variable ies_len is being assigned but never read.

---
 drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/wireless/ath/ath6kl/cfg80211.c +0 -2
index b53eb2b..2ba8cf3 100644
@@ -2766,7 +2766,6 @@ static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev,
 	struct ieee80211_mgmt *mgmt;
 	bool hidden = false;
 	u8 *ies;
-	int ies_len;
 	struct wmi_connect_cmd p;
 	int res;
 	int i, ret;
@@ -2804,7 +2803,6 @@ static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev,
 	ies = mgmt->u.beacon.variable;
 	if (ies > info->beacon.head + info->beacon.head_len)
 		return -EINVAL;
-	ies_len = info->beacon.head + info->beacon.head_len - ies;
 
 	if (info->ssid == NULL)
 		return -EINVAL;
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Kenneth Lu

To get rid of W=3D1 warning: variable =E2=80=98ies_len=E2=80=99 set but n=

ot used.

drivers/net/wir=

Quoted 8 lines

Variable ies_len is being assigned but never read.

---
 drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/wir= renamed from drivers/net/wireless/ath/ath6kl/cfg80211.c +0 -0

eless/ath/ath6kl/cfg80211.c

drivers/net/wireless/ath/ath6kl/cfg80211.c static int ath6kl_start_ap(struct wiphy *wiphy, str=

Quoted 4 lines

index b53eb2b..2ba8cf3 100644

drivers/net/wireless/ath/ath6kl/cfg80211.c +0 -0
@@ -2766,7 +2766,6 @@ static int ath6kl_start_ap(struct wiphy *wiphy, str=

uct net_device *dev,

drivers/net/wireless/ath/ath6kl/cfg80211.c static int ath6kl_start_ap(struct wiphy *wiphy, str=

Quoted 8 lines
drivers/net/wireless/ath/ath6kl/cfg80211.c +0 -1
        struct ieee80211_mgmt *mgmt;
        bool hidden =3D false;
        u8 *ies;
-       int ies_len;
        struct wmi_connect_cmd p;
        int res;
        int i, ret;
@@ -2804,7 +2803,6 @@ static int ath6kl_start_ap(struct wiphy *wiphy, str=

uct net_device *dev,

drivers/net/wireless/ath/ath6kl/cfg80211.c static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev, · line 2808

Quoted 7 lines
drivers/net/wireless/ath/ath6kl/cfg80211.c +0 -1
        ies =3D mgmt->u.beacon.variable;
        if (ies > info->beacon.head + info->beacon.head_len)
                return -EINVAL;
-       ies_len =3D info->beacon.head + info->beacon.head_len - ies;
 
        if (info->ssid =3D=3D NULL)
                return -EINVAL;

Oddly, ies_len was never even used in the original patch that added it. Probably used in some debugging code that was stripped before submitting. Seems safe to kill it.

- Steve

#2 lore raw
In reply to Kenneth Lu
Quoted 6 lines · Kenneth Lu

To get rid of W=1 warning: variable ‘ies_len’ set but not used. Variable ies_len is being assigned but never read.

Patch applied to ath-next branch of ath.git, thanks.

d786ebb2f59b ath6kl: remove redundant variable ies_len

Signature · 3 lines
https://patchwork.kernel.org/patch/10075235/

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