Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756763AbbDUW1d (ORCPT ); Tue, 21 Apr 2015 18:27:33 -0400 Received: from smtprelay0028.hostedemail.com ([216.40.44.28]:34438 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755941AbbDUW1b (ORCPT ); Tue, 21 Apr 2015 18:27:31 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599: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:2828:3138:3139:3140:3141:3142:3352:3622:3653:3865:3867:3868:3870:3872:3873:3874:4321:4605:5007:6261:9010:10004:10400:10481:10848:11026:11232:11473:11658:11914:12043:12114:12438:12517:12519:12740:13069:13255:13311:13357:19900: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: shop80_245265f2edb22 X-Filterd-Recvd-Size: 2174 Message-ID: <1429655247.31675.20.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: Tue, 21 Apr 2015 15:27:27 -0700 In-Reply-To: <5536C4C2.4000001@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> 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: 1297 Lines: 41 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: > (...) > >> > >> Perhaps it would be smarter to use (for both patches) $stat instead. > >> This applies also to existing checks (like PREFER_ETHER_ADDR_COPY) > >> so we can catch calls formatted like > >> > >> memset(very.long.structure->something.something_different42, > >> 0xFF, ETH_ALEN); > > > > Yes, likely that's true. > > > > checkpatch couldn't --fix it easily unless it's on a > > single line though. > > 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/; } } No worries about getting 'round the the list. It'll get got eventually. -- 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/