zd1211rw: slight optimization of addr compare
Subsystems (3)
PATCH 6/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 <[email protected]>
Cc Ulrich Kunitz <[email protected]>
Cc "John W. Linville" <[email protected]>
Signed-off-by Tan Xiaojun <[email protected]>
Signed-off-by Ding Tianhong <[email protected]>
--- drivers/net/wireless/zd1211rw/zd_mac.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/zd1211rw/zd_mac.c +4 -3
@@ -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 ;
Signature · 1 line
1.8.0