[<prev] [next>] [day] [month] [year] [list]
Message-ID: <52B7C5B1.7090103@huawei.com>
Date: Mon, 23 Dec 2013 13:10:09 +0800
From: Ding Tianhong <dingtianhong@...wei.com>
To: Daniel Drake <dsd@...too.org>, Ulrich Kunitz <kune@...ne-taler.de>,
"John W. Linville" <linville@...driver.com>,
<linux-wireless@...r.kernel.org>, Netdev <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH 06/21] zd1211rw: slight optimization of addr compare
Use the recently added and possibly more efficient
ether_addr_equal_unaligned to instead of memcmp.
Cc: Daniel Drake <dsd@...too.org>
Cc: Ulrich Kunitz <kune@...ne-taler.de>
Cc: "John W. Linville" <linville@...driver.com>
Cc: linux-wireless@...r.kernel.org
Cc: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Signed-off-by: Tan Xiaojun <tanxiaojun@...wei.com>
Signed-off-by: Ding Tianhong <dingtianhong@...wei.com>
---
drivers/net/wireless/zd1211rw/zd_mac.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index eff79a3..57badfb 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -532,9 +532,9 @@ 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_unaligned(tx_hdr->addr1,
+ tx_status->mac)))
continue;
- }
/* we skip all frames not matching the reported final rate */
@@ -997,7 +997,8 @@ 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_unaligned(tx_hdr->addr2,
+ rx_hdr->addr1)))
{
found = 1;
break;
--
1.8.0
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists