* [PATCH net-next v2 17/20] net: ti: slight optimization of addr compare
@ 2013-12-28 6:18 Ding Tianhong
0 siblings, 0 replies; only message in thread
From: Ding Tianhong @ 2013-12-28 6:18 UTC (permalink / raw)
To: David S. Miller, Netdev, linux-kernel@vger.kernel.org
Use possibly more efficient ether_addr_equal
to instead of memcmp.
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
drivers/net/ethernet/ti/cpsw_ale.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
index 7fa60d6..63e9819 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -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;
--
1.8.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-12-28 6:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-28 6:18 [PATCH net-next v2 17/20] net: ti: slight optimization of addr compare Ding Tianhong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.