From: dingtianhong Date: Mon, 30 Dec 2013 07:40:46 +0000 (+0800) Subject: net: igbvf: slight optimization of addr compare X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=887fa9d8f4b9d0a37af7ffaa64b7b4d02cfa19ef;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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);