Subject: [PATCH net-next v2 07/20] net: ixgbe: slight optimization of addr compare

From: Ding Tianhong <[email-masked]>
Date: Sat, 28 Dec 2013 14:17:33 +0800

Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc: Jeff Kirsher <[email-masked]>
Cc: Jesse Brandeburg <[email-masked]>
Cc: Bruce Allan <[email-masked]>
Signed-off-by: Ding Tianhong <[email-masked]>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index d6f0c0d..9ce07f3 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -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",
-- 
1.8.0