]> www.infradead.org Git - linux.git/commitdiff
wifi: iwlwifi: mvm: declare band variable in the scope
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Mon, 27 May 2024 16:06:11 +0000 (19:06 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 29 May 2024 08:34:00 +0000 (10:34 +0200)
band is not used outside of the for loop, declare it inside it.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://msgid.link/20240527190228.b634d184980a.I9d9e71125f9a77ba4f9a33a7a2ff1e8e78e17767@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c

index 5132964661c8093308c53f8ecc10aec3c52bf620..712dabb30acc4831eeecfbb2a54d277601ff5fc9 100644 (file)
@@ -1730,7 +1730,6 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
        const u16 *nvm_chan;
        struct ieee80211_regdomain *regd, *copy_rd;
        struct ieee80211_reg_rule *rule;
-       enum nl80211_band band;
        int center_freq, prev_center_freq = 0;
        int valid_rules = 0;
        bool new_rule;
@@ -1774,8 +1773,10 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
        reg_capa = iwl_get_reg_capa(cap, resp_ver);
 
        for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) {
+               enum nl80211_band band =
+                       iwl_nl80211_band_from_channel_idx(ch_idx);
+
                ch_flags = (u16)__le32_to_cpup(channels + ch_idx);
-               band = iwl_nl80211_band_from_channel_idx(ch_idx);
                center_freq = ieee80211_channel_to_frequency(nvm_chan[ch_idx],
                                                             band);
                new_rule = false;