net: igbvf: slight optimization of addr compare
Subsystems (3)
PATCH v2 6/20 net: igbvf: slight optimization of addr compare
Use possibly more efficient ether_addr_equal to instead of memcmp.
--- drivers/net/ethernet/intel/igbvf/netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igbvf/netdev.c +1 -1
@@ -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
Quoted 11 lines · Ding Tianhong
Use possibly more efficient
ether_addr_equalto instead of memcmp.Cc Jeff Kirsher <[email protected]>Cc Jesse Brandeburg <[email protected]>Cc Carolyn Wyborny <[email protected]>Cc Don Skidmore <[email protected]>Signed-off-by Ding Tianhong <[email protected]>--- drivers/net/ethernet/intel/igbvf/netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks Ding, I will update the patch in my queue with this updated version.
Quoted 8 lines
From: [email protected] [mailto:[email protected]] On Behalf Of Ding Tianhong
Sent: Friday, December 27, 2013 10:17 PM
To: Kirsher, Jeffrey T; Brandeburg, Jesse; Wyborny, Carolyn; Skidmore, Donald C; David S. Miller; Netdev; [email protected]
Subject: [PATCH net-next v2 06/20] net: igbvf: slight optimization of addr compare
Quoted 7 lines
Use possibly more efficient
ether_addr_equalto instead of memcmp.Cc Jeff Kirsher <[email protected]>Cc Jesse Brandeburg <[email protected]>Cc Carolyn Wyborny <[email protected]>Cc Don Skidmore <[email protected]>Signed-off-by Ding Tianhong <[email protected]>
Tested by: Aaron Brown <[email protected]>
Quoted 27 lines
--- drivers/net/ethernet/intel/igbvf/netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/igbvf/netdev.c +1
-1@@ -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 netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html