]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use for_each_link() where possible
authorBenjamin Berg <benjamin@sipsolutions.net>
Tue, 20 Feb 2024 13:18:13 +0000 (14:18 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 2 Mar 2024 09:12:13 +0000 (11:12 +0200)
This takes care of the places that the spatch did not catch already.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
wpa_supplicant/events.c

index 42cde3c8a810a03c6515bb4a7320fc9f0f6dfb47..cdc17b3c99f6df7b78bf304ec918e56712a8c2f4 100644 (file)
@@ -4034,12 +4034,9 @@ static int wpa_sm_set_ml_info(struct wpa_supplicant *wpa_s)
        wpa_mlo.valid_links = drv_mlo.valid_links;
        wpa_mlo.req_links = drv_mlo.req_links;
 
-       for (i = 0; i < MAX_NUM_MLD_LINKS; i++) {
+       for_each_link(drv_mlo.req_links, i) {
                struct wpa_bss *bss;
 
-               if (!(drv_mlo.req_links & BIT(i)))
-                       continue;
-
                bss = wpa_supplicant_get_new_bss(wpa_s, drv_mlo.links[i].bssid);
                if (!bss) {
                        wpa_supplicant_update_scan_results(wpa_s);
@@ -5863,13 +5860,10 @@ static void wpas_tid_link_map(struct wpa_supplicant *wpa_s,
        pos += res;
 
        if (!info->default_map) {
-               for (i = 0; i < MAX_NUM_MLD_LINKS && end > pos; i++) {
+               for_each_link(info->valid_links, i) {
                        char uplink_map_str[9];
                        char downlink_map_str[9];
 
-                       if (!(info->valid_links & BIT(i)))
-                               continue;
-
                        bitmap_to_str(info->t2lmap[i].uplink, uplink_map_str);
                        bitmap_to_str(info->t2lmap[i].downlink,
                                      downlink_map_str);