]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: remove unused variables in minstrel_ht_alloc_sta
authorJiajia Liu <liujiajia@kylinos.cn>
Tue, 7 Apr 2026 06:32:05 +0000 (14:32 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 7 Apr 2026 13:40:25 +0000 (15:40 +0200)
Remove the unused variable max_rates and related code. Also remove the
variable mi and pass type to kzalloc_obj instead.

Signed-off-by: Jiajia Liu <liujiajia@kylinos.cn>
Link: https://patch.msgid.link/20260407063205.68471-1-liujiajia@kylinos.cn
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rc80211_minstrel_ht.c

index 62745ca00e06aa3c67b810a26c737b6999518a95..b73ef3adfcc576908eb8743ff5db2ba2b2710cc6 100644 (file)
@@ -1849,20 +1849,7 @@ minstrel_ht_rate_update(void *priv, struct ieee80211_supported_band *sband,
 static void *
 minstrel_ht_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
 {
-       struct ieee80211_supported_band *sband;
-       struct minstrel_ht_sta *mi;
-       struct minstrel_priv *mp = priv;
-       struct ieee80211_hw *hw = mp->hw;
-       int max_rates = 0;
-       int i;
-
-       for (i = 0; i < NUM_NL80211_BANDS; i++) {
-               sband = hw->wiphy->bands[i];
-               if (sband && sband->n_bitrates > max_rates)
-                       max_rates = sband->n_bitrates;
-       }
-
-       return kzalloc_obj(*mi, gfp);
+       return kzalloc_obj(struct minstrel_ht_sta, gfp);
 }
 
 static void