Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751483AbbEYRhT (ORCPT ); Mon, 25 May 2015 13:37:19 -0400 Received: from smtprelay0132.hostedemail.com ([216.40.44.132]:59824 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751327AbbEYRhR (ORCPT ); Mon, 25 May 2015 13:37:17 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:4605:5007:6261:7514:10004:10400:10848:11026:11232:11658:11914:12043:12114:12296:12438:12517:12519:12555:12740:13069:13161:13229:13255:13311:13357:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: guide09_3f4807b784b11 X-Filterd-Recvd-Size: 2530 Message-ID: <1432575433.2846.62.camel@perches.com> Subject: Re: [PATCH v4 06/35] staging: rtl8192e: Replace memcmp() with ether_addr_equal_unaligned() From: Joe Perches To: Dan Carpenter Cc: Mateusz Kulikowski , gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Mon, 25 May 2015 10:37:13 -0700 In-Reply-To: <20150525140336.GC11588@mwanda> References: <1432223628-1664-1-git-send-email-mateusz.kulikowski@gmail.com> <1432223628-1664-7-git-send-email-mateusz.kulikowski@gmail.com> <20150525140336.GC11588@mwanda> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1723 Lines: 44 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: > > Use dedicated macro to compare ethernet addresses in probe_rq_parse(). > > > > Signed-off-by: Mateusz Kulikowski > > --- > > drivers/staging/rtl8192e/rtllib_softmac.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c > > index 8689b16..65297a0 100644 > > --- a/drivers/staging/rtl8192e/rtllib_softmac.c > > +++ b/drivers/staging/rtl8192e/rtllib_softmac.c > > @@ -1853,7 +1853,8 @@ static short probe_rq_parse(struct rtllib_device *ieee, struct sk_buff *skb, > > return -1; /* corrupted */ > > > > 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. 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/