cfg80211: use compare_ether_addr on MAC addresses instead of memcmp
Because of the constant size and guaranteed 16 bit alignment, the inline compare_ether_addr function is much cheaper than calling memcmp. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
4272a27f2f
commit
c6fb08aaa8
@@ -378,7 +378,7 @@ static int cmp_bss_core(struct cfg80211_bss *a,
|
||||
b->len_information_elements);
|
||||
}
|
||||
|
||||
return memcmp(a->bssid, b->bssid, ETH_ALEN);
|
||||
return compare_ether_addr(a->bssid, b->bssid);
|
||||
}
|
||||
|
||||
static int cmp_bss(struct cfg80211_bss *a,
|
||||
|
Reference in New Issue
Block a user