mac80211: make ieee80211_wep_init() return void
authorLuca Coelho <luciano.coelho@intel.com>
Fri, 31 Jan 2020 11:12:47 +0000 (13:12 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 7 Feb 2020 11:40:34 +0000 (12:40 +0100)
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>
net/mac80211/main.c
net/mac80211/wep.c
net/mac80211/wep.h

index 287dd05884760709d2b09522deccc4ff27666a84..d91bcef738dc51b10d7911a78770f24ba3a6cd92 100644 (file)
@@ -1185,10 +1185,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
        if (!local->hw.weight_multiplier)
                local->hw.weight_multiplier = 1;
 
-       result = ieee80211_wep_init(local);
-       if (result < 0)
-               wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n",
-                           result);
+       ieee80211_wep_init(local);
 
        local->hw.conf.flags = IEEE80211_CONF_IDLE;
 
index b75c2c54e6657f2bfc7e1fd66e45fc602065f9ed..9a6e11d7b4db65add59456e9c1aca009c54db96f 100644 (file)
 #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 */
        get_random_bytes(&local->wep_iv, IEEE80211_WEP_IV_LEN);
-
-       return 0;
 }
 
 static inline bool ieee80211_wep_weak_iv(u32 iv, int keylen)
index 997a034233c20bc5f2d134c56332f424d0bbff42..4ffe83554c67beeae0e8ec3a6bae1c37ce24853b 100644 (file)
@@ -13,7 +13,7 @@
 #include "ieee80211_i.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,
                                size_t klen, u8 *data, size_t data_len);
 int ieee80211_wep_encrypt(struct ieee80211_local *local,