Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

zd1211rw: slight optimization of addr compare

Use possibly more efficient ether_addr_equal
instead of memcmp.

Cc: Daniel Drake <dsd@gentoo.org>
Cc: Ulrich Kunitz <kune@deine-taler.de>
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: Tan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

dingtianhong and committed by
David S. Miller
c15975ac 323813ed

+2 -3
+2 -3
drivers/net/wireless/zd1211rw/zd_mac.c
··· 532 532 tx_hdr = (struct ieee80211_hdr *)skb->data; 533 533 534 534 /* we skip all frames not matching the reported destination */ 535 - if (unlikely(memcmp(tx_hdr->addr1, tx_status->mac, ETH_ALEN))) { 535 + if (unlikely(!ether_addr_equal(tx_hdr->addr1, tx_status->mac))) 536 536 continue; 537 - } 538 537 539 538 /* we skip all frames not matching the reported final rate */ 540 539 ··· 996 997 continue; 997 998 998 999 tx_hdr = (struct ieee80211_hdr *)skb->data; 999 - if (likely(!memcmp(tx_hdr->addr2, rx_hdr->addr1, ETH_ALEN))) 1000 + if (likely(ether_addr_equal(tx_hdr->addr2, rx_hdr->addr1))) 1000 1001 { 1001 1002 found = 1; 1002 1003 break;