Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: make ieee80211_wep_init() return void

This function always returns 0, so there's no point in returning int.
Make it void and remove the impossible error-path when calling it.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/20200131111300.891737-11-luca@coelho.fi
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Luca Coelho and committed by
Johannes Berg
4a65cc24 07b83d2e

+3 -8
+1 -4
net/mac80211/main.c
··· 1185 1185 if (!local->hw.weight_multiplier) 1186 1186 local->hw.weight_multiplier = 1; 1187 1187 1188 - result = ieee80211_wep_init(local); 1189 - if (result < 0) 1190 - wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", 1191 - result); 1188 + ieee80211_wep_init(local); 1192 1189 1193 1190 local->hw.conf.flags = IEEE80211_CONF_IDLE; 1194 1191
+1 -3
net/mac80211/wep.c
··· 22 22 #include "wep.h" 23 23 24 24 25 - int ieee80211_wep_init(struct ieee80211_local *local) 25 + void ieee80211_wep_init(struct ieee80211_local *local) 26 26 { 27 27 /* start WEP IV from a random value */ 28 28 get_random_bytes(&local->wep_iv, IEEE80211_WEP_IV_LEN); 29 - 30 - return 0; 31 29 } 32 30 33 31 static inline bool ieee80211_wep_weak_iv(u32 iv, int keylen)
+1 -1
net/mac80211/wep.h
··· 13 13 #include "ieee80211_i.h" 14 14 #include "key.h" 15 15 16 - int ieee80211_wep_init(struct ieee80211_local *local); 16 + void ieee80211_wep_init(struct ieee80211_local *local); 17 17 int ieee80211_wep_encrypt_data(struct arc4_ctx *ctx, u8 *rc4key, 18 18 size_t klen, u8 *data, size_t data_len); 19 19 int ieee80211_wep_encrypt(struct ieee80211_local *local,