diff options
author | dingtianhong <dingtianhong@huawei.com> | 2013-12-30 11:41:14 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-01 01:48:32 +0400 |
commit | 6878f79a8b71e8c7b0587a1185584f54fd31f185 (patch) | |
tree | c2f8e1b873f63b423937f7c24369699fe408b021 /drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | |
parent | 202af853ccdf1c23e81d1899145d21e9a4c6d5a6 (diff) | |
download | linux-6878f79a8b71e8c7b0587a1185584f54fd31f185.tar.xz |
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_hw.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c index 3fe971c59b8c..a9a149b82375 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c @@ -462,7 +462,7 @@ int qlcnic_nic_del_mac(struct qlcnic_adapter *adapter, const u8 *addr) /* Delete MAC from the existing list */ list_for_each(head, &adapter->mac_list) { cur = list_entry(head, struct qlcnic_mac_vlan_list, list); - if (memcmp(addr, cur->mac_addr, ETH_ALEN) == 0) { + if (ether_addr_equal(addr, cur->mac_addr)) { err = qlcnic_sre_macaddr_change(adapter, cur->mac_addr, 0, QLCNIC_MAC_DEL); if (err) @@ -483,7 +483,7 @@ int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, const u8 *addr, u16 vlan) /* look up if already exists */ list_for_each(head, &adapter->mac_list) { cur = list_entry(head, struct qlcnic_mac_vlan_list, list); - if (memcmp(addr, cur->mac_addr, ETH_ALEN) == 0 && + if (ether_addr_equal(addr, cur->mac_addr) && cur->vlan_id == vlan) return 0; } |