mac80211: remove set but not used variable ‘old’ [Linux 5.2]

mac80211: remove set but not used variable ‘old’ [Linux 5.2]

This Linux kernel change "mac80211: remove set but not used variable ‘old’" is included in the Linux 5.2 release. This change is authored by YueHaibing <yuehaibing [at] huawei.com> on Mon Apr 29 14:07:54 2019 +0000. The commit for this change in Linux stable tree is 818e9df (patch).

mac80211: remove set but not used variable 'old'

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 <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 net/mac80211/key.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 20bf9db..89f09a0 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -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);

Leave a Reply

Your email address will not be published. Required fields are marked *