lkml.org 
[lkml]   [2013]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH net-next 20/20] net: caif: slight optimization of addr compare
Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
net/caif/cfrfml.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/caif/cfrfml.c b/net/caif/cfrfml.c
index 61d7617..c680414 100644
--- a/net/caif/cfrfml.c
+++ b/net/caif/cfrfml.c
@@ -79,7 +79,7 @@ static struct cfpkt *rfm_append(struct cfrfml *rfml, char *seghead,
return NULL;

/* Verify correct header */
- if (memcmp(seghead, rfml->seghead, 6) != 0)
+ if (!ether_addr_equal(seghead, rfml->seghead))
return NULL;

tmppkt = cfpkt_append(rfml->incomplete_frm, pkt,
--
1.8.0



\
 
 \ /
  Last update: 2013-12-27 08:41    [W:0.112 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site