Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031266AbbDWXyP (ORCPT ); Thu, 23 Apr 2015 19:54:15 -0400 Received: from smtprelay0151.hostedemail.com ([216.40.44.151]:40778 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030875AbbDWXyN (ORCPT ); Thu, 23 Apr 2015 19:54:13 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:960:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3353:3622:3653:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:5007:6261:9036:10004:10400:10481:10848:11232:11473:11658:11914:12114:12517:12519:12740:13019:13069:13255:13311:13357:19900:21067: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: trail11_24711ce7e2b35 X-Filterd-Recvd-Size: 2363 Message-ID: <1429833248.32612.46.camel@perches.com> Subject: Re: [PATCH v2 2/2] checkpatch: suggest using eth_zero_addr() and eth_broadcast_addr() From: Joe Perches To: Mateusz Kulikowski Cc: apw@canonical.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 23 Apr 2015 16:54:08 -0700 In-Reply-To: <55394DA8.3060705@gmail.com> References: <1429481816-6664-1-git-send-email-mateusz.kulikowski@gmail.com> <1429481816-6664-3-git-send-email-mateusz.kulikowski@gmail.com> <1429492384.27863.13.camel@perches.com> <5536B9D2.7030200@gmail.com> <1429651348.31675.12.camel@perches.com> <5536C4C2.4000001@gmail.com> <1429655247.31675.20.camel@perches.com> <55394DA8.3060705@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 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: 1411 Lines: 44 On Thu, 2015-04-23 at 21:53 +0200, Mateusz Kulikowski wrote: > On 22.04.2015 00:27, Joe Perches wrote: > > On Tue, 2015-04-21 at 23:44 +0200, Mateusz Kulikowski wrote: > >> On 21.04.2015 23:22, Joe Perches wrote: > >>> On Tue, 2015-04-21 at 22:57 +0200, Mateusz Kulikowski wrote: > >> (...) > (...) > >> True, True; If you prefer $line and ability to --fix - I'll use that in v3 > > > > I suppose you could do both $line and $stat > > and the fix would only work when it's on a > > single line. > > > > Perhaps something like this would work: > > > > if ($line =~ /whatever/ || > > (defined($stat) && $stat =~ /whatever/)) { > > if (WARN(...) && > > $fix) { > > fixed[$fixlinenr] =~ s/whatever/appropriate/; > > } > > } > > Isn't it enough to just match $stat and do fix for line (that in > some cases will just not match)? Yeah, that'd work too. > One more thing > I noticed funny behavior about $stat matches - > it reports the same error several times (including as "scope" whole file) > Is it feature or "feature" or I missed something? You have to make sure the first character of $stat is a + if ($stat =~ /\+(?:.*)\bmem -- 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/