[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 17 Dec 2013 09:58:52 +0800
From: Ding Tianhong <dingtianhong@...wei.com>
To: Joe Perches <joe@...ches.com>, Ding Tianhong <dthxman@...il.com>
CC: "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
On 2013/12/17 1:25, Joe Perches wrote:
> 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)
>
>
>
great, thanks, I 'll try and test.
Regards
ding
>
--
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