]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ipw2x00: remove redundant variables len, ret, reason and crypt
authorColin Ian King <colin.king@canonical.com>
Wed, 11 Jul 2018 07:12:12 +0000 (08:12 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 31 Jul 2018 07:18:16 +0000 (10:18 +0300)
Variables len, ret, reason and crypt are assigned values that
are never read, hence they are redundant and can be removed.

Note: For the variable ret, a return code is being assigned, but
this is not returned and 0 is currently being returned, I believe
this is OK.

Cleans up clang warnings:
warning: variable 'len' set but not used [-Wunused-but-set-variable]
variable 'ret' set but not used [-Wunused-but-set-variable]
warning: variable 'reason' set but not used [-Wunused-but-set-variable]
warning: variable 'crypt' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/intel/ipw2x00/ipw2100.c
drivers/net/wireless/intel/ipw2x00/libipw_wx.c

index 1ad83ef5f202e0f2d7ae6f1919d2b11aa21b52b2..910db46db6a12ea2c74cf3b9e42a7a42ea9a7351 100644 (file)
@@ -5112,11 +5112,9 @@ static int ipw2100_disassociate_bssid(struct ipw2100_priv *priv)
                .host_command_length = ETH_ALEN
        };
        int err;
-       int len;
 
        IPW_DEBUG_HC("DISASSOCIATION_BSSID\n");
 
-       len = ETH_ALEN;
        /* The Firmware currently ignores the BSSID and just disassociates from
         * the currently associated AP -- but in the off chance that a future
         * firmware does use the BSSID provided here, we go ahead and try and
@@ -7723,7 +7721,6 @@ static int ipw2100_wx_get_auth(struct net_device *dev,
        struct libipw_device *ieee = priv->ieee;
        struct lib80211_crypt_data *crypt;
        struct iw_param *param = &wrqu->param;
-       int ret = 0;
 
        switch (param->flags & IW_AUTH_INDEX) {
        case IW_AUTH_WPA_VERSION:
@@ -7733,7 +7730,6 @@ static int ipw2100_wx_get_auth(struct net_device *dev,
                /*
                 * wpa_supplicant will control these internally
                 */
-               ret = -EOPNOTSUPP;
                break;
 
        case IW_AUTH_TKIP_COUNTERMEASURES:
@@ -7801,9 +7797,6 @@ static int ipw2100_wx_set_mlme(struct net_device *dev,
 {
        struct ipw2100_priv *priv = libipw_priv(dev);
        struct iw_mlme *mlme = (struct iw_mlme *)extra;
-       __le16 reason;
-
-       reason = cpu_to_le16(mlme->reason_code);
 
        switch (mlme->cmd) {
        case IW_MLME_DEAUTH:
index dd29f46d086b2bf2f60586655fb59ff9647c0b0c..d32d39fa268625097aafb993c4aa44fdf6909b6c 100644 (file)
@@ -479,7 +479,6 @@ int libipw_wx_get_encode(struct libipw_device *ieee,
 {
        struct iw_point *erq = &(wrqu->encoding);
        int len, key;
-       struct lib80211_crypt_data *crypt;
        struct libipw_security *sec = &ieee->sec;
 
        LIBIPW_DEBUG_WX("GET_ENCODE\n");
@@ -492,7 +491,6 @@ int libipw_wx_get_encode(struct libipw_device *ieee,
        } else
                key = ieee->crypt_info.tx_keyidx;
 
-       crypt = ieee->crypt_info.crypt[key];
        erq->flags = key + 1;
 
        if (!sec->enabled) {