From: dingtianhong Date: Thu, 26 Dec 2013 11:40:43 +0000 (+0800) Subject: zd1211rw: slight optimization of addr compare X-Git-Tag: MMI-PSA29.97-13-9~12877^2~393^2~12 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c15975ac60527e9e2d2c05487ea20b1ca50d490d;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git zd1211rw: slight optimization of addr compare Use possibly more efficient ether_addr_equal instead of memcmp. Cc: Daniel Drake Cc: Ulrich Kunitz Cc: "John W. Linville" Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Tan Xiaojun Signed-off-by: Ding Tianhong Signed-off-by: David S. Miller --- diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index eff79a37bc2a..e7af261e9198 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c @@ -532,9 +532,8 @@ void zd_mac_tx_failed(struct urb *urb) tx_hdr = (struct ieee80211_hdr *)skb->data; /* we skip all frames not matching the reported destination */ - if (unlikely(memcmp(tx_hdr->addr1, tx_status->mac, ETH_ALEN))) { + if (unlikely(!ether_addr_equal(tx_hdr->addr1, tx_status->mac))) continue; - } /* we skip all frames not matching the reported final rate */ @@ -997,7 +996,7 @@ static int filter_ack(struct ieee80211_hw *hw, struct ieee80211_hdr *rx_hdr, continue; tx_hdr = (struct ieee80211_hdr *)skb->data; - if (likely(!memcmp(tx_hdr->addr2, rx_hdr->addr1, ETH_ALEN))) + if (likely(ether_addr_equal(tx_hdr->addr2, rx_hdr->addr1))) { found = 1; break;