From 887fa9d8f4b9d0a37af7ffaa64b7b4d02cfa19ef Mon Sep 17 00:00:00 2001 From: dingtianhong Date: Mon, 30 Dec 2013 15:40:46 +0800 Subject: [PATCH] net: igbvf: slight optimization of addr compare Use possibly more efficient ether_addr_equal to instead of memcmp. Cc: Jeff Kirsher Cc: Jesse Brandeburg Cc: Carolyn Wyborny Cc: Don Skidmore Signed-off-by: Ding Tianhong Signed-off-by: David S. Miller --- 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 04bf22e5ee31..675435fc2e53 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); -- 2.20.1