net: igbvf: slight optimization of addr compare
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: Carolyn Wyborny <carolyn.wyborny@intel.com> Cc: Don Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
61d23e9f3d
commit
887fa9d8f4
|
@ -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);
|
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;
|
return -EADDRNOTAVAIL;
|
||||||
|
|
||||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||||
|
|
Loading…
Reference in New Issue