net: ixgbe: slight optimization of addr compare
authordingtianhong <dingtianhong@huawei.com>
Mon, 30 Dec 2013 07:40:50 +0000 (15:40 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Dec 2013 21:48:31 +0000 (16:48 -0500)
Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c

index d6f0c0d8cf11ddb395617e2749bbf25329cae42c..9ce07f3ef62d69d5112098a46f1bf88fe33cec62 100644 (file)
@@ -715,8 +715,7 @@ static int ixgbe_set_vf_mac_addr(struct ixgbe_adapter *adapter,
        }
 
        if (adapter->vfinfo[vf].pf_set_mac &&
-           memcmp(adapter->vfinfo[vf].vf_mac_addresses, new_mac,
-                  ETH_ALEN)) {
+           !ether_addr_equal(adapter->vfinfo[vf].vf_mac_addresses, new_mac)) {
                e_warn(drv,
                       "VF %d attempted to override administratively set MAC address\n"
                       "Reload the VF driver to resume operations\n",