[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1387214748.18217.52.camel@joe-AO722>
Date: Mon, 16 Dec 2013 09:25:48 -0800
From: Joe Perches <joe@...ches.com>
To: Ding Tianhong <dthxman@...il.com>
Cc: Ding Tianhong <dingtianhong@...wei.com>,
"David S. Miller" <davem@...emloft.net>,
Netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v2 0/6] slight optimization of addr compare for
some modules
Hi again Ding.
These should still be inspected for appropriate use of
ether_addr_equal or ether_addr_equal_unaligned, but a
better cocci input sp-file is:
$ cat ether_addr_equal_unaligned.cocci
@@
expression e1;
expression e2;
@@
- !memcmp(e1, e2, \(6\|ETH_ALEN\))
+ ether_addr_equal_unaligned(e1, e2)
@@
expression e1;
expression e2;
@@
- memcmp(e1, e2, \(6\|ETH_ALEN\)) == 0
+ ether_addr_equal_unaligned(e1, e2)
@@
expression e1;
expression e2;
@@
- memcmp(e1, e2, \(6\|ETH_ALEN\))
+ !ether_addr_equal_unaligned(e1, e2)
@@
expression e1;
expression e2;
@@
- memcmp(e1, e2, \(6\|ETH_ALEN\)) != 0
+ !ether_addr_equal_unaligned(e1, e2)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists