forked from Minki/linux
cw1200: slight optimization of addr compare
Use possibly more efficient ether_addr_equal instead of memcmp. Cc: Solomon Peachy <pizza@shaftnet.org> Cc: John W. Linville <linville@tuxdriver.com> Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Weilong Chen <chenweilong@huawei.com> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d22fbd70c2
commit
35df5388ac
@ -13,6 +13,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/etherdevice.h>
|
||||
|
||||
#include "cw1200.h"
|
||||
#include "sta.h"
|
||||
@ -555,8 +556,8 @@ u64 cw1200_prepare_multicast(struct ieee80211_hw *hw,
|
||||
pr_debug("[STA] multicast: %pM\n", ha->addr);
|
||||
memcpy(&priv->multicast_filter.macaddrs[count],
|
||||
ha->addr, ETH_ALEN);
|
||||
if (memcmp(ha->addr, broadcast_ipv4, ETH_ALEN) &&
|
||||
memcmp(ha->addr, broadcast_ipv6, ETH_ALEN))
|
||||
if (!ether_addr_equal(ha->addr, broadcast_ipv4) &&
|
||||
!ether_addr_equal(ha->addr, broadcast_ipv6))
|
||||
priv->has_multicast_subscription = true;
|
||||
count++;
|
||||
}
|
||||
|
@ -1166,8 +1166,7 @@ void cw1200_rx_cb(struct cw1200_common *priv,
|
||||
return;
|
||||
} else if (ieee80211_is_beacon(frame->frame_control) &&
|
||||
!arg->status && priv->vif &&
|
||||
!memcmp(ieee80211_get_SA(frame), priv->vif->bss_conf.bssid,
|
||||
ETH_ALEN)) {
|
||||
ether_addr_equal(ieee80211_get_SA(frame), priv->vif->bss_conf.bssid)) {
|
||||
const u8 *tim_ie;
|
||||
u8 *ies = ((struct ieee80211_mgmt *)
|
||||
(skb->data))->u.beacon.variable;
|
||||
|
Loading…
Reference in New Issue
Block a user