Skip to contentSkip to conversation

net: ti: 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 17/19 net: ti: slight optimization of addr compare

Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc "David S. Miller" <[email protected]>
---
 drivers/net/ethernet/ti/cpsw_ale.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/ti/cpsw_ale.c +1 -1
index 7fa60d6..63e9819 100644
@@ -163,7 +163,7 @@ int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
 		if (cpsw_ale_get_vlan_id(ale_entry) != vid)
 			continue;
 		cpsw_ale_get_addr(ale_entry, entry_addr);
-		if (memcmp(entry_addr, addr, 6) == 0)
+		if (ether_addr_equal(entry_addr, addr))
 			return idx;
 	}
 	return -ENOENT;
Signature · 1 line
1.8.0