Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751677AbbEZTzk (ORCPT ); Tue, 26 May 2015 15:55:40 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:34595 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751143AbbEZTzh (ORCPT ); Tue, 26 May 2015 15:55:37 -0400 Message-ID: <5564CFB6.7000809@gmail.com> Date: Tue, 26 May 2015 21:55:34 +0200 From: Mateusz Kulikowski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Joe Perches , Dan Carpenter CC: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 06/35] staging: rtl8192e: Replace memcmp() with ether_addr_equal_unaligned() References: <1432223628-1664-1-git-send-email-mateusz.kulikowski@gmail.com> <1432223628-1664-7-git-send-email-mateusz.kulikowski@gmail.com> <20150525140336.GC11588@mwanda> <1432575433.2846.62.camel@perches.com> In-Reply-To: <1432575433.2846.62.camel@perches.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1438 Lines: 41 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/