lkml.org 
[lkml]   [2015]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 06/35] staging: rtl8192e: Replace memcmp() with ether_addr_equal_unaligned()
On 25.05.2015 19:37, Joe Perches wrote:
> On Mon, 2015-05-25 at 17:03 +0300, Dan Carpenter wrote:
>> On Thu, May 21, 2015 at 05:53:19PM +0200, Mateusz Kulikowski wrote:
(...)
>>> bssid_match =
>>> - (memcmp(header->addr3, ieee->current_network.bssid, ETH_ALEN) != 0) &&
>>> + (!ether_addr_equal_unaligned(header->addr3,
>>> + ieee->current_network.bssid)) &&
>>
>> Isn't this aligned?
>>
>> Joe, I really dread these checkpatch.pl patches. It's the kind of thing
>> I hate more as time goes on and not less...
>
> Yeah,
>
> I thought that Mateusz was going to send a
> checkpatch patch for ether_addr_equal_unaligned
> to make the memcpy thing a bit clearer.

I'm a bit confused here;
I used unaligned incorrectly in that context - it's my mistake, but
it couldn't be prevented by checkpatch as it is too simple to understand
structure member alignment.

As for using ether_addr* family instead of mem* - It's nice
syntactic sugar for slow-path code.

> Of course this thing is really only useful for
> non x86 systems and then only when the memcpy is
> in a fast-path like multicasting so really it's
> not very commonly a significant improvement in
> the first place.





\
 
 \ /
  Last update: 2015-05-26 22:21    [W:0.094 / U:2.920 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site