mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-22 11:34:07 +01:00
network: replace l_queue_get_entries loop
After adding network_bss_update, network now has a match_addr queue function which can be used to replace an unneeded l_queue_get_entries loop with l_queue_find.
This commit is contained in:
parent
88d0a6a7c0
commit
4577ee01f2
@ -712,17 +712,7 @@ struct scan_bss *network_bss_list_pop(struct network *network)
|
|||||||
struct scan_bss *network_bss_find_by_addr(struct network *network,
|
struct scan_bss *network_bss_find_by_addr(struct network *network,
|
||||||
const uint8_t *addr)
|
const uint8_t *addr)
|
||||||
{
|
{
|
||||||
const struct l_queue_entry *bss_entry;
|
return l_queue_find(network->bss_list, match_addr, addr);
|
||||||
|
|
||||||
for (bss_entry = l_queue_get_entries(network->bss_list); bss_entry;
|
|
||||||
bss_entry = bss_entry->next) {
|
|
||||||
struct scan_bss *bss = bss_entry->data;
|
|
||||||
|
|
||||||
if (!memcmp(bss->addr, addr, sizeof(bss->addr)))
|
|
||||||
return bss;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool match_bss(const void *a, const void *b)
|
static bool match_bss(const void *a, const void *b)
|
||||||
|
Loading…
Reference in New Issue
Block a user