Subject: [PATCH net-next 06/20] net: igbvf: slight optimization of addr compare

From: Ding Tianhong <[email-masked]>
Date: Fri, 27 Dec 2013 14:48:27 +0800

Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc: Jeff Kirsher <[email-masked]>
Cc: Jesse Brandeburg <[email-masked]>
Cc: Carolyn Wyborny <[email-masked]>
Cc: Don Skidmore <[email-masked]>
Signed-off-by: Ding Tianhong <[email-masked]>
---
 drivers/net/ethernet/intel/igbvf/netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 04bf22e..675435f 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -1745,7 +1745,7 @@ static int igbvf_set_mac(struct net_device *netdev, void *p)
 
 	hw->mac.ops.rar_set(hw, hw->mac.addr, 0);
 
-	if (memcmp(addr->sa_data, hw->mac.addr, 6))
+	if (!ether_addr_equal(addr->sa_data, hw->mac.addr))
 		return -EADDRNOTAVAIL;
 
 	memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
-- 
1.8.0