From 93dc5e429b4d8ac8d683b61052592812e9353f9f Mon Sep 17 00:00:00 2001 From: dingtianhong Date: Thu, 26 Dec 2013 19:40:47 +0800 Subject: ozwpan: slight optimization of addr compare Use possibly more efficient ether_addr_equal instead of memcmp. Cc: Rupesh Gujare Cc: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Tan Xiaojun Signed-off-by: Ding Tianhong Signed-off-by: David S. Miller --- drivers/staging/ozwpan/ozproto.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/staging/ozwpan/ozproto.c') diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c index 88714ec85705..19a2521ee179 100644 --- a/drivers/staging/ozwpan/ozproto.c +++ b/drivers/staging/ozwpan/ozproto.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include "ozdbg.h" @@ -180,7 +181,7 @@ static struct oz_pd *oz_connect_req(struct oz_pd *cur_pd, struct oz_elt *elt, spin_lock_bh(&g_polling_lock); list_for_each(e, &g_pd_list) { pd2 = container_of(e, struct oz_pd, link); - if (memcmp(pd2->mac_addr, pd_addr, ETH_ALEN) == 0) { + if (ether_addr_equal(pd2->mac_addr, pd_addr)) { free_pd = pd; pd = pd2; break; @@ -597,7 +598,7 @@ struct oz_pd *oz_pd_find(const u8 *mac_addr) spin_lock_bh(&g_polling_lock); list_for_each(e, &g_pd_list) { pd = container_of(e, struct oz_pd, link); - if (memcmp(pd->mac_addr, mac_addr, ETH_ALEN) == 0) { + if (ether_addr_equal(pd->mac_addr, mac_addr)) { atomic_inc(&pd->ref_count); spin_unlock_bh(&g_polling_lock); return pd; -- cgit v1.2.3-59-g8ed1b