netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ding Tianhong <dingtianhong@huawei.com>
To: Joe Perches <joe@perches.com>, Ding Tianhong <dthxman@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>, Netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v2 0/6] slight optimization of addr compare for some modules
Date: Tue, 17 Dec 2013 09:58:52 +0800	[thread overview]
Message-ID: <52AFAFDC.2080807@huawei.com> (raw)
In-Reply-To: <1387214748.18217.52.camel@joe-AO722>

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

> 

  reply	other threads:[~2013-12-17  2:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16  8:24 [PATCH net-next v2 0/6] slight optimization of addr compare for some modules Ding Tianhong
2013-12-16 14:45 ` Joe Perches
2013-12-16 14:53   ` Ding Tianhong
2013-12-16 15:16     ` Joe Perches
2013-12-16 17:25       ` Joe Perches
2013-12-17  1:58         ` Ding Tianhong [this message]
2013-12-18  8:47           ` Ding Tianhong
2013-12-18  9:17             ` Joe Perches
2013-12-18  9:35               ` Ding Tianhong
2013-12-18 10:06               ` Ding Tianhong
2013-12-18 16:51                 ` Joe Perches
2013-12-19  1:24                   ` Ding Tianhong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52AFAFDC.2080807@huawei.com \
    --to=dingtianhong@huawei.com \
    --cc=davem@davemloft.net \
    --cc=dthxman@gmail.com \
    --cc=joe@perches.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).