wifi: mac80211: mlme: clean up supported channels element code
authorJohannes Berg <johannes.berg@intel.com>
Tue, 12 Jul 2022 11:40:02 +0000 (13:40 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 15 Jul 2022 09:43:21 +0000 (11:43 +0200)
Clean up the code building the supported channels element
a little bit by using a local variable instead of the long
line.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mlme.c

index 3cb1f091f17e95c7db2bcb0a67710380d201ce75..b55d10464b7d400c61cd10e69149a7963c1c7172 100644 (file)
@@ -1078,8 +1078,9 @@ static int ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
                *pos++ = WLAN_EID_SUPPORTED_CHANNELS;
                *pos++ = 2 * sband->n_channels;
                for (i = 0; i < sband->n_channels; i++) {
-                       *pos++ = ieee80211_frequency_to_channel(
-                                       sband->channels[i].center_freq);
+                       int cf = sband->channels[i].center_freq;
+
+                       *pos++ = ieee80211_frequency_to_channel(cf);
                        *pos++ = 1; /* one channel in the subband*/
                }
        }