Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752561AbdLDTMm (ORCPT ); Mon, 4 Dec 2017 14:12:42 -0500 Received: from smtprelay0120.hostedemail.com ([216.40.44.120]:50652 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751269AbdLDTMl (ORCPT ); Mon, 4 Dec 2017 14:12:41 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2110:2197:2199:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3873:3874:4250:4321:5007:6742:7903:8957:10004:10400:10848:11026:11232:11473:11658:11914:12043:12114:12296:12438:12555:12740:12760:12895:12986:13095:13255:13439:14181:14659:14721:21080:21221:21365:21433:21451:21627:30012:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: use33_6e45beb06bf45 X-Filterd-Recvd-Size: 3424 Message-ID: <1512414756.6321.54.camel@perches.com> Subject: Re: [PATCH tip/core/rcu 20/21] checkpatch: Add warnings for {smp_,}read_barrier_depends() From: Joe Perches To: paulmck@linux.vnet.ibm.com Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, Andy Whitcroft Date: Mon, 04 Dec 2017 11:12:36 -0800 In-Reply-To: <20171204190646.GD7829@linux.vnet.ibm.com> References: <20171201195053.GA23494@linux.vnet.ibm.com> <1512157876-24665-20-git-send-email-paulmck@linux.vnet.ibm.com> <1512159257.19952.167.camel@perches.com> <20171201214416.GJ7829@linux.vnet.ibm.com> <1512189913.19952.184.camel@perches.com> <20171204190646.GD7829@linux.vnet.ibm.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-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: 2059 Lines: 54 On Mon, 2017-12-04 at 11:06 -0800, Paul E. McKenney wrote: > On Fri, Dec 01, 2017 at 08:45:13PM -0800, Joe Perches wrote: > > On Fri, 2017-12-01 at 13:44 -0800, Paul E. McKenney wrote: > > > If you really wanted to optimize, you could make the first (smp_|) > > become (?:smp_|) to avoid the unused capture group. > > Or perhaps this could emit the actual type in the message like: > > > > if (!$file && $line =~ /\b((?:smp_|)read_barrier_depends)\s*\(/ { > > WARN("READ_BARRIER_DEPENDS", > > "$1 should only be used in READ_ONCE or DEC Alpha code\n" . $herecurr); > > How about like this? (s/$1/$1read_barrier_depends/). Works for me. Acked-by: Joe Perches Are you going to merge this? Normally akpm does checkpatch merging but whatever works for you is OK by me. cheers, Joe > commit e4f1d781e33c150547c68e55099794b98ee14d5e > Author: Paul E. McKenney > Date: Mon Nov 27 09:37:35 2017 -0800 > {smp_,}read_barrier_depends() > > Now that both smp_read_barrier_depends() and read_barrier_depends() > are being de-emphasized, warn if any are added. > > Signed-off-by: Paul E. McKenney > Cc: Andy Whitcroft > Cc: Joe Perches > [ paulmck: Skipped checking files and handled whitespace per Joe Perches. > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 95cda3ecc66b..9a384bfe2bd5 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -5586,6 +5586,12 @@ sub process { > } > } > > +# check for smp_read_barrier_depends and read_barrier_depends > + if (!$file && $line =~ /\b(smp_|)read_barrier_depends\s*\(/) { > + WARN("READ_BARRIER_DEPENDS", > + "$1read_barrier_depends should only be used in READ_ONCE or DEC Alpha code\n" . $herecurr); > + } > + > # check of hardware specific defines > if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) { > CHK("ARCH_DEFINES", >