Subject: Re: [PATCH net-next v2 0/6] slight optimization of addr compare for some modules

From: Ding Tianhong <[email-masked]>
Date: Wed, 18 Dec 2013 16:47:26 +0800

On 2013/12/17 9:58, Ding Tianhong wrote:
> 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
> 

Hi Joe:

There are too many places need to be changed, should I make it in one patch or several pathset,
pls give me some advise. thanks

Regards
Ding