Skip to content

Commit 35df538

Browse files
dingtianhongdavem330
authored andcommitted
cw1200: slight optimization of addr compare
Use possibly more efficient ether_addr_equal instead of memcmp. Cc: Solomon Peachy <[email protected]> Cc: John W. Linville <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Weilong Chen <[email protected]> Signed-off-by: Ding Tianhong <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d22fbd7 commit 35df538

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/net/wireless/cw1200/sta.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/sched.h>
1414
#include <linux/firmware.h>
1515
#include <linux/module.h>
16+
#include <linux/etherdevice.h>
1617

1718
#include "cw1200.h"
1819
#include "sta.h"
@@ -555,8 +556,8 @@ u64 cw1200_prepare_multicast(struct ieee80211_hw *hw,
555556
pr_debug("[STA] multicast: %pM\n", ha->addr);
556557
memcpy(&priv->multicast_filter.macaddrs[count],
557558
ha->addr, ETH_ALEN);
558-
if (memcmp(ha->addr, broadcast_ipv4, ETH_ALEN) &&
559-
memcmp(ha->addr, broadcast_ipv6, ETH_ALEN))
559+
if (!ether_addr_equal(ha->addr, broadcast_ipv4) &&
560+
!ether_addr_equal(ha->addr, broadcast_ipv6))
560561
priv->has_multicast_subscription = true;
561562
count++;
562563
}

drivers/net/wireless/cw1200/txrx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,8 +1166,7 @@ void cw1200_rx_cb(struct cw1200_common *priv,
11661166
return;
11671167
} else if (ieee80211_is_beacon(frame->frame_control) &&
11681168
!arg->status && priv->vif &&
1169-
!memcmp(ieee80211_get_SA(frame), priv->vif->bss_conf.bssid,
1170-
ETH_ALEN)) {
1169+
ether_addr_equal(ieee80211_get_SA(frame), priv->vif->bss_conf.bssid)) {
11711170
const u8 *tim_ie;
11721171
u8 *ies = ((struct ieee80211_mgmt *)
11731172
(skb->data))->u.beacon.variable;

0 commit comments

Comments
 (0)