Commit 4a65cc24 authored by Luca Coelho's avatar Luca Coelho Committed by Johannes Berg

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: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/20200131111300.891737-11-luca@coelho.fiSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 07b83d2e
...@@ -1185,10 +1185,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) ...@@ -1185,10 +1185,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
if (!local->hw.weight_multiplier) if (!local->hw.weight_multiplier)
local->hw.weight_multiplier = 1; local->hw.weight_multiplier = 1;
result = ieee80211_wep_init(local); ieee80211_wep_init(local);
if (result < 0)
wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n",
result);
local->hw.conf.flags = IEEE80211_CONF_IDLE; local->hw.conf.flags = IEEE80211_CONF_IDLE;
......
...@@ -22,12 +22,10 @@ ...@@ -22,12 +22,10 @@
#include "wep.h" #include "wep.h"
int ieee80211_wep_init(struct ieee80211_local *local) void ieee80211_wep_init(struct ieee80211_local *local)
{ {
/* start WEP IV from a random value */ /* start WEP IV from a random value */
get_random_bytes(&local->wep_iv, IEEE80211_WEP_IV_LEN); get_random_bytes(&local->wep_iv, IEEE80211_WEP_IV_LEN);
return 0;
} }
static inline bool ieee80211_wep_weak_iv(u32 iv, int keylen) static inline bool ieee80211_wep_weak_iv(u32 iv, int keylen)
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "ieee80211_i.h" #include "ieee80211_i.h"
#include "key.h" #include "key.h"
int ieee80211_wep_init(struct ieee80211_local *local); void ieee80211_wep_init(struct ieee80211_local *local);
int ieee80211_wep_encrypt_data(struct arc4_ctx *ctx, u8 *rc4key, int ieee80211_wep_encrypt_data(struct arc4_ctx *ctx, u8 *rc4key,
size_t klen, u8 *data, size_t data_len); size_t klen, u8 *data, size_t data_len);
int ieee80211_wep_encrypt(struct ieee80211_local *local, int ieee80211_wep_encrypt(struct ieee80211_local *local,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment