Skip to contentSkip to conversation

net: enic: slight optimization of addr compare

PATCH In review Ding Tianhong 3 participants 3 messages Dec 30, 2013 – Jan 2, 2014

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

PATCH v3 4/19 net: enic: slight optimization of addr compare

Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc Christian Benvenuti <[email protected]>
Cc Sujith Sankar <[email protected]>
Cc Govindarajulu Varadarajan <[email protected]>
Cc Neel Patel <[email protected]>
Cc Nishank Trivedi <[email protected]>
---
 drivers/net/ethernet/cisco/enic/enic_pp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cisco/enic/enic_pp.c +1 -1
index 43464f0..e6a8319 100644
@@ -162,7 +162,7 @@ static int enic_are_pp_different(struct enic_port_profile *pp1,
 	return strcmp(pp1->name, pp2->name) | !!memcmp(pp1->instance_uuid,
 		pp2->instance_uuid, PORT_UUID_MAX) |
 		!!memcmp(pp1->host_uuid, pp2->host_uuid, PORT_UUID_MAX) |
-		!!memcmp(pp1->mac_addr, pp2->mac_addr, ETH_ALEN);
+		!ether_addr_equal(pp1->mac_addr, pp2->mac_addr);
 }
 
 static int enic_pp_preassociate(struct enic *enic, int vf,
Signature · 1 line
1.8.0
Acked-by on v3 4/19
#1 lore raw
Quoted 29 lines · Ding Tianhong

Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc Christian Benvenuti <[email protected]>
Cc Sujith Sankar <[email protected]>
Cc Govindarajulu Varadarajan <[email protected]>
Cc Neel Patel <[email protected]>
Cc Nishank Trivedi <[email protected]>

---
drivers/net/ethernet/cisco/enic/enic_pp.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cisco/enic/enic_pp.c +1 -1
index 43464f0..e6a8319 100644
@@ -162,7 +162,7 @@ static int enic_are_pp_different(struct enic_port_profile *pp1,
 	return strcmp(pp1->name, pp2->name) | !!memcmp(pp1->instance_uuid,
 		pp2->instance_uuid, PORT_UUID_MAX) |
 		!!memcmp(pp1->host_uuid, pp2->host_uuid, PORT_UUID_MAX) |
-		!!memcmp(pp1->mac_addr, pp2->mac_addr, ETH_ALEN);
+		!ether_addr_equal(pp1->mac_addr, pp2->mac_addr);
 }
 
 static int enic_pp_preassociate(struct enic *enic, int vf,
Signature · 1 line
1.8.0

looks good for me

#2 lore raw

Looks good.

Acked by: Sujith Sankar <[email protected]>

Quoted 37 lines · Govindarajulu Varadarajan (gvaradar)
Quoted 27 lines · Ding Tianhong

Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc Christian Benvenuti <[email protected]>
Cc Sujith Sankar <[email protected]>
Cc Govindarajulu Varadarajan <[email protected]>
Cc Neel Patel <[email protected]>
Cc Nishank Trivedi <[email protected]>

---
drivers/net/ethernet/cisco/enic/enic_pp.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cisco/enic/enic_pp.c +1 -1
index 43464f0..e6a8319 100644
@@ -162,7 +162,7 @@ static int enic_are_pp_different(struct
 enic_port_profile *pp1,
 	return strcmp(pp1->name, pp2->name) | !!memcmp(pp1->instance_uuid,
 		pp2->instance_uuid, PORT_UUID_MAX) |
 		!!memcmp(pp1->host_uuid, pp2->host_uuid, PORT_UUID_MAX) |
-		!!memcmp(pp1->mac_addr, pp2->mac_addr, ETH_ALEN);
+		!ether_addr_equal(pp1->mac_addr, pp2->mac_addr);
 }
 
Quoted 4 lines

static int enic_pp_preassociate(struct enic *enic, int vf,

Signature · 1 line
1.8.0

looks good for me