mac80211: remove set but not used variable 'old'
authorYueHaibing <yuehaibing@huawei.com>
Mon, 29 Apr 2019 14:07:54 +0000 (14:07 +0000)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 24 May 2019 09:26:44 +0000 (11:26 +0200)
Fixes gcc '-Wunused-but-set-variable' warning:

net/mac80211/key.c: In function 'ieee80211_set_tx_key':
net/mac80211/key.c:271:24: warning:
 variable 'old' set but not used [-Wunused-but-set-variable]

It is not used since introduction in
commit 96fc6efb9ad9 ("mac80211: IEEE 802.11 Extended Key ID support")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/key.c

index 20bf9db7a3886de7601fabd0e0ff2c721e54e30e..89f09a09efdb7c6a3bd13bf91f1e82c9186e766e 100644 (file)
@@ -268,11 +268,9 @@ int ieee80211_set_tx_key(struct ieee80211_key *key)
 {
        struct sta_info *sta = key->sta;
        struct ieee80211_local *local = key->local;
-       struct ieee80211_key *old;
 
        assert_key_lock(local);
 
-       old = key_mtx_dereference(local, sta->ptk[sta->ptk_idx]);
        sta->ptk_idx = key->conf.keyidx;
        ieee80211_check_fast_xmit(sta);