diff mbox

ath6kl: remove redundant variable ies_len

Message ID 20171126053818.GA6602@blackstone (mailing list archive)
State Accepted
Commit d786ebb2f59b46e95c17bc33018fc13347407f69
Delegated to: Kalle Valo
Headers show

Commit Message

Kenneth Lu Nov. 26, 2017, 5:38 a.m. UTC
To get rid of W=1 warning: variable ‘ies_len’ set but not used.
Variable ies_len is being assigned but never read.

Signed-off-by: Kenneth Lu <kuohsianglu@gmail.com>
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Steve deRosier Nov. 27, 2017, 7:19 p.m. UTC | #1
On Sat, Nov 25, 2017 at 9:38 PM, Kenneth Lu <kuohsianglu@gmail.com> wrote:
> To get rid of W=1 warning: variable ‘ies_len’ set but not used.
> Variable ies_len is being assigned but never read.
>
> Signed-off-by: Kenneth Lu <kuohsianglu@gmail.com>
> ---
>  drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
> index b53eb2b..2ba8cf3 100644
> --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
> +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
> @@ -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;

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.

Reviewed-by: Steve deRosier <derosier@gmail.com>

- Steve
Kalle Valo Dec. 7, 2017, 2:21 p.m. UTC | #2
Kenneth Lu <kuohsianglu@gmail.com> wrote:

> To get rid of W=1 warning: variable ‘ies_len’ set but not used.
> Variable ies_len is being assigned but never read.
> 
> Signed-off-by: Kenneth Lu <kuohsianglu@gmail.com>
> Reviewed-by: Steve deRosier <derosier@gmail.com>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>

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

d786ebb2f59b ath6kl: remove redundant variable ies_len
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index b53eb2b..2ba8cf3 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -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;