diff options
author | Johannes Berg <johannes.berg@intel.com> | 2023-08-28 09:54:39 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-09-11 11:27:23 +0200 |
commit | e8c1841278a78362f7034f3de415096ddb19f097 (patch) | |
tree | 2c5068e9417c0a71d8cf3ca199bd667657af2498 /drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | |
parent | 05f136220d17839eb7c155f015ace9152f603225 (diff) | |
download | linux-e8c1841278a78362f7034f3de415096ddb19f097.tar.gz linux-e8c1841278a78362f7034f3de415096ddb19f097.tar.bz2 linux-e8c1841278a78362f7034f3de415096ddb19f097.zip |
wifi: cfg80211: annotate iftype_data pointer with sparse
There were are a number of cases in mac80211 and iwlwifi (at
least) that used the sband->iftype_data pointer directly,
instead of using the accessors to find the right array entry
to use.
Make sparse warn when such a thing is done.
To not have a lot of casts, add two helper functions/macros
- ieee80211_set_sband_iftype_data()
- for_each_sband_iftype_data()
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c index 31176897b746..cff1f97536e3 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c @@ -1077,8 +1077,8 @@ static void iwl_init_he_hw_capab(struct iwl_trans *trans, memcpy(iftype_data, iwl_he_eht_capa, sizeof(iwl_he_eht_capa)); - sband->iftype_data = iftype_data; - sband->n_iftype_data = ARRAY_SIZE(iwl_he_eht_capa); + _ieee80211_set_sband_iftype_data(sband, iftype_data, + ARRAY_SIZE(iwl_he_eht_capa)); for (i = 0; i < sband->n_iftype_data; i++) iwl_nvm_fixup_sband_iftd(trans, data, sband, &iftype_data[i], |