mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-30 06:02:39 +01:00
ap: Simplify ap_common_rates
If we've checked that the STA has included our Basic Rate we've already found one common rate, no need for further checks.
This commit is contained in:
parent
f011b81b19
commit
a26ca0fb66
14
src/ap.c
14
src/ap.c
@ -795,19 +795,11 @@ static void ap_disassociate_sta(struct ap_state *ap, struct sta_state *sta)
|
||||
static bool ap_common_rates(struct l_uintset *ap_rates,
|
||||
struct l_uintset *sta_rates)
|
||||
{
|
||||
uint32_t r, minr, maxr;
|
||||
|
||||
minr = l_uintset_find_min(ap_rates);
|
||||
maxr = l_uintset_find_max(ap_rates);
|
||||
uint32_t minr = l_uintset_find_min(ap_rates);
|
||||
|
||||
/* Our lowest rate is a Basic Rate so must be supported */
|
||||
if (!l_uintset_contains(sta_rates, minr))
|
||||
return false;
|
||||
|
||||
for (r = minr + 1; r <= maxr; r++)
|
||||
if (l_uintset_contains(ap_rates, r) &&
|
||||
l_uintset_contains(sta_rates, r))
|
||||
return true;
|
||||
if (l_uintset_contains(sta_rates, minr))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user