summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
diff options
context:
space:
mode:
authordingtianhong <dingtianhong@huawei.com>2013-12-30 15:41:14 +0800
committerDavid S. Miller <davem@davemloft.net>2013-12-31 16:48:32 -0500
commit6878f79a8b71e8c7b0587a1185584f54fd31f185 (patch)
treec2f8e1b873f63b423937f7c24369699fe408b021 /drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
parent202af853ccdf1c23e81d1899145d21e9a4c6d5a6 (diff)
downloadlinux-6878f79a8b71e8c7b0587a1185584f54fd31f185.tar.gz
linux-6878f79a8b71e8c7b0587a1185584f54fd31f185.tar.bz2
linux-6878f79a8b71e8c7b0587a1185584f54fd31f185.zip
net: qlcnic: slight optimization of addr compare
Use the possibly more efficient ether_addr_equal or ether_addr_equal_unaligned to instead of memcmp. Cc: Himanshu Madhani <himanshu.madhani@qlogic.com> Cc: Rajesh Borundia <rajesh.borundia@qlogic.com> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c')
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
index 053802277992..a215e0f69335 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
@@ -202,7 +202,7 @@ static struct qlcnic_filter *qlcnic_find_mac_filter(struct hlist_head *head,
struct hlist_node *n;
hlist_for_each_entry_safe(tmp_fil, n, head, fnode) {
- if (!memcmp(tmp_fil->faddr, addr, ETH_ALEN) &&
+ if (ether_addr_equal(tmp_fil->faddr, addr) &&
tmp_fil->vlan_id == vlan_id)
return tmp_fil;
}
@@ -346,7 +346,7 @@ static void qlcnic_send_filter(struct qlcnic_adapter *adapter,
head = &(adapter->fhash.fhead[hindex]);
hlist_for_each_entry_safe(tmp_fil, n, head, fnode) {
- if (!memcmp(tmp_fil->faddr, &src_addr, ETH_ALEN) &&
+ if (ether_addr_equal(tmp_fil->faddr, &src_addr) &&
tmp_fil->vlan_id == vlan_id) {
if (jiffies > (QLCNIC_READD_AGE * HZ + tmp_fil->ftime))
qlcnic_change_filter(adapter, &src_addr,