Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc: Jeff Kirsher <jeffrey.t.kirs...@intel.com>
Cc: Jesse Brandeburg <jesse.brandeb...@intel.com>
Cc: Carolyn Wyborny <carolyn.wybo...@intel.com>
Cc: Don Skidmore <donald.c.skidm...@intel.com>
Signed-off-by: Ding Tianhong <dingtianh...@huawei.com>
---
 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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to