lib80211: remove unused variables iv32 and iv16
Subsystems (3)
PATCH 1/1 lib80211: remove unused variables iv32 and iv16
clang with W=1 reports net/wireless/lib80211_crypt_tkip.c:667:7: error: variable 'iv32'
set but not used [-Werror,-Wunused-but-set-variable]
u32 iv32 = tkey->tx_iv32;
^This variable not used so remove it.
Then remove a similar iv16 variable. Remove the comment because the length is returned.
--- net/wireless/lib80211_crypt_tkip.c | 6 ------ 1 file changed, 6 deletions(-)
net/wireless/lib80211_crypt_tkip.c +0 -6
@@ -662,12 +662,6 @@ static int lib80211_tkip_get_key(void *key, int len, u8 * seq, void *priv)memcpy (key, tkey->key,TKIP_KEY_LEN );if (seq) { -/* Return the sequence number of the last transmitted frame. */ -u16 iv16 = tkey->tx_iv16; -u32 iv32 = tkey->tx_iv32; -if (iv16 ==0 ) - iv32--; - iv16--; seq[0 ] = tkey->tx_iv16; seq[1 ] = tkey->tx_iv16 >>8 ; seq[2 ] = tkey->tx_iv32;
Signature · 1 line
2.27.0
Quoted 10 lines · Tom Rix
clang with W=1 reports
net/wireless/lib80211_crypt_tkip.c:667:7: error: variable 'iv32'
set but not used [-Werror,-Wunused-but-set-variable]u32 iv32 = tkey->tx_iv32; ^This variable not used so remove it.
Then remove a similar iv16 variable. Remove the comment because the length is returned.Signed-off-by Tom Rix <[email protected]>
Johannes Berg
maintainerQuoted 19 lines · Tom Rix
clang with W=1 reports
net/wireless/lib80211_crypt_tkip.c:667:7: error: variable 'iv32'
set but not used [-Werror,-Wunused-but-set-variable]u32 iv32 = tkey->tx_iv32; ^This variable not used so remove it.
Then remove a similar iv16 variable. Remove the comment because the length is returned.Signed-off-by Tom Rix <[email protected]>--- net/wireless/lib80211_crypt_tkip.c | 6 ------ 1 file changed, 6 deletions(-)net/wireless/lib80211_crypt_tkip.c +0
-0
net/wireless/lib80211_crypt_tkip.c static int lib80211_tkip_get_key(void *key, int len, u8 * seq, void *priv) · line 665
Quoted 10 lines
net/wireless/lib80211_crypt_tkip.c +0
-6@@ -662,12 +662,6 @@ static int lib80211_tkip_get_key(void *key, int len, u8 * seq, void *priv)memcpy (key, tkey->key,TKIP_KEY_LEN );if (seq) { -/* Return the sequence number of the last transmitted frame. */ -u16 iv16 = tkey->tx_iv16; -u32 iv32 = tkey->tx_iv32; -if (iv16 ==0 ) - iv32--; - iv16--;
FWIW, this has come up before, and we weren't sure that this really is right and shouldn't have reported the iv32/iv16 values out to userspace
...
That said, it's unlikely anyone would ever go and test his code again, so I guess we might as well clean this up to get rid of the warning.
Maybe leave a comment?
johannes