public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 20/20] net: caif: slight optimization of addr compare
@ 2013-12-28  6:18 Ding Tianhong
  2013-12-28  6:59 ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Ding Tianhong @ 2013-12-28  6:18 UTC (permalink / raw)
  To: Dmitry Tarnyagin, David S. Miller, Netdev,
	linux-kernel@vger.kernel.org

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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-12-30  2:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-28  6:18 [PATCH net-next v2 20/20] net: caif: slight optimization of addr compare Ding Tianhong
2013-12-28  6:59 ` Joe Perches
2013-12-28 15:02   ` Ding Tianhong
2013-12-28 17:04     ` Joe Perches
2013-12-30  2:14       ` Ding Tianhong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox