Commit 35df5388 authored by dingtianhong's avatar dingtianhong Committed by David S. Miller

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: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d22fbd70
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/firmware.h> #include <linux/firmware.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/etherdevice.h>
#include "cw1200.h" #include "cw1200.h"
#include "sta.h" #include "sta.h"
...@@ -555,8 +556,8 @@ u64 cw1200_prepare_multicast(struct ieee80211_hw *hw, ...@@ -555,8 +556,8 @@ u64 cw1200_prepare_multicast(struct ieee80211_hw *hw,
pr_debug("[STA] multicast: %pM\n", ha->addr); pr_debug("[STA] multicast: %pM\n", ha->addr);
memcpy(&priv->multicast_filter.macaddrs[count], memcpy(&priv->multicast_filter.macaddrs[count],
ha->addr, ETH_ALEN); ha->addr, ETH_ALEN);
if (memcmp(ha->addr, broadcast_ipv4, ETH_ALEN) && if (!ether_addr_equal(ha->addr, broadcast_ipv4) &&
memcmp(ha->addr, broadcast_ipv6, ETH_ALEN)) !ether_addr_equal(ha->addr, broadcast_ipv6))
priv->has_multicast_subscription = true; priv->has_multicast_subscription = true;
count++; count++;
} }
......
...@@ -1166,8 +1166,7 @@ void cw1200_rx_cb(struct cw1200_common *priv, ...@@ -1166,8 +1166,7 @@ void cw1200_rx_cb(struct cw1200_common *priv,
return; return;
} else if (ieee80211_is_beacon(frame->frame_control) && } else if (ieee80211_is_beacon(frame->frame_control) &&
!arg->status && priv->vif && !arg->status && priv->vif &&
!memcmp(ieee80211_get_SA(frame), priv->vif->bss_conf.bssid, ether_addr_equal(ieee80211_get_SA(frame), priv->vif->bss_conf.bssid)) {
ETH_ALEN)) {
const u8 *tim_ie; const u8 *tim_ie;
u8 *ies = ((struct ieee80211_mgmt *) u8 *ies = ((struct ieee80211_mgmt *)
(skb->data))->u.beacon.variable; (skb->data))->u.beacon.variable;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment