From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751477AbdFGIbT (ORCPT ); Wed, 7 Jun 2017 04:31:19 -0400 Received: from smtprelay0076.hostedemail.com ([216.40.44.76]:56551 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751414AbdFGIbQ (ORCPT ); Wed, 7 Jun 2017 04:31:16 -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:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2197:2199:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3353:3622:3653:3865:3866:3867:3868:3870:3871:3872:4321:5007:7514:7875:7903:10004:10400:10848:11026:11232:11658:11914:12555:12740:12760:12895:13141:13230:13439:14181:14659:14721:21080:21221:21627:30054: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:2,LUA_SUMMARY:none X-HE-Tag: sugar98_27f5b8f49be40 X-Filterd-Recvd-Size: 3020 Message-ID: <1496824273.1968.42.camel@perches.com> Subject: Re: [PATCH] checkpatch: Silence perl 5.26.0 unescaped left brace warnings From: Joe Perches To: Cyril Bur , apw@canonical.com, Andrew Morton Cc: linux-kernel@vger.kernel.org Date: Wed, 07 Jun 2017 01:31:13 -0700 In-Reply-To: <20170607060135.17384-1-cyrilbur@gmail.com> References: <20170607060135.17384-1-cyrilbur@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 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 On Wed, 2017-06-07 at 16:01 +1000, Cyril Bur wrote: > As of perl 5, version 26, subversion 0 (v5.26.0) some new warnings have > occurred when running checkpatch. > > Unescaped left brace in regex is deprecated here (and will be fatal in > Perl 5.30), passed through in regex; marked by <-- HERE in m/^(.\s*){ > <-- HERE \s*/ at scripts/checkpatch.pl line 3544. > > Unescaped left brace in regex is deprecated here (and will be fatal in > Perl 5.30), passed through in regex; marked by <-- HERE in m/^(.\s*){ > <-- HERE \s*/ at scripts/checkpatch.pl line 3885. > > Unescaped left brace in regex is deprecated here (and will be fatal in > Perl 5.30), passed through in regex; marked by <-- HERE in > m/^(\+.*(?:do|\))){ <-- HERE / at scripts/checkpatch.pl line 4374. > > It seems perfectly reasonable to do as the warning suggests and simply > escape the left brace in these three locations. > > Signed-off-by: Cyril Bur Acked-by: Joe Perches > --- > scripts/checkpatch.pl | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 4b9569fa931b..33e50614a5d9 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -3541,7 +3541,7 @@ sub process { > $fixedline =~ s/\s*=\s*$/ = {/; > fix_insert_line($fixlinenr, $fixedline); > $fixedline = $line; > - $fixedline =~ s/^(.\s*){\s*/$1/; > + $fixedline =~ s/^(.\s*)\{\s*/$1/; > fix_insert_line($fixlinenr, $fixedline); > } > } > @@ -3882,7 +3882,7 @@ sub process { > my $fixedline = rtrim($prevrawline) . " {"; > fix_insert_line($fixlinenr, $fixedline); > $fixedline = $rawline; > - $fixedline =~ s/^(.\s*){\s*/$1\t/; > + $fixedline =~ s/^(.\s*)\{\s*/$1\t/; > if ($fixedline !~ /^\+\s*$/) { > fix_insert_line($fixlinenr, $fixedline); > } > @@ -4371,7 +4371,7 @@ sub process { > if (ERROR("SPACING", > "space required before the open brace '{'\n" . $herecurr) && > $fix) { > - $fixed[$fixlinenr] =~ s/^(\+.*(?:do|\))){/$1 {/; > + $fixed[$fixlinenr] =~ s/^(\+.*(?:do|\)))\{/$1 {/; > } > } >