Skip to contentSkip to conversation

net: igbvf: slight optimization of addr compare

PATCH In review Ding Tianhong 1 participant 1 message Dec 30, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 6/19 net: igbvf: slight optimization of addr compare

Use possibly more efficient ether_addr_equal to instead of memcmp.

Cc Jeff Kirsher <[email protected]>
Cc Jesse Brandeburg <[email protected]>
Cc Carolyn Wyborny <[email protected]>
Cc Don Skidmore <[email protected]>
---
 drivers/net/ethernet/intel/igbvf/netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igbvf/netdev.c +1 -1
index 04bf22e..675435f 100644
@@ -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);
Signature · 1 line
1.8.0