Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754447AbbLOX6f (ORCPT ); Tue, 15 Dec 2015 18:58:35 -0500 Received: from mail-vk0-f41.google.com ([209.85.213.41]:33087 "EHLO mail-vk0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751388AbbLOX6d (ORCPT ); Tue, 15 Dec 2015 18:58:33 -0500 MIME-Version: 1.0 In-Reply-To: References: <1449529586.7162.10.camel@perches.com> Date: Tue, 15 Dec 2015 20:58:32 -0300 Message-ID: Subject: Re: [BUG] checkpatch: unescaped left brace in regex is deprecated From: "Geyslan G. Bem" To: Joe Perches Cc: Robo Bot , LKML , Peter Senna Tschudin Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5165 Lines: 168 2015-12-10 8:24 GMT-03:00 Geyslan G. Bem : > 2015-12-09 19:59 GMT-03:00 Geyslan G. Bem : >> >> >> 2015-12-07 20:36 GMT-03:00 Geyslan G. Bem : >>> >>> 2015-12-07 20:06 GMT-03:00 Joe Perches : >>> > On Mon, 2015-12-07 at 19:53 -0300, Geyslan G. Bem wrote: >>> >> Hello, >>> > >>> > hello. >>> > >>> >> Follow checkpatch output using perl 5.22.0. >>> >> >>> >> geyslan@hb ~/Projects/linux $ scripts/checkpatch.pl -f >>> >> drivers/usb/host/ehci-hub.c >>> >> Unescaped left brace in regex is deprecated, passed through in regex; >>> >> marked by <-- HERE in m/\((?^x: >>> >> >>> > >>> > No HERE here. Are you using linux-next? >>> Yep, >>> >>> geyslan@hb ~/Projects/linux $ git branch -a >>> * (HEAD detached from linux-next/master) >>> ... >>> >>> geyslan@hb ~/Projects/linux $ git remote update >>> Fetching linux >>> Fetching linux-next >>> Fetching linux-staging >>> >>> > >>> > There have been patches applied for this warning already. >>> > >>> > see: >>> > >>> > commit 4e5d56bdf892e18832a6540b63ebf709966bce2a >>> > Author: Eddie Kovsky >>> > Date: Wed Sep 9 15:37:52 2015 -0700 >>> > >>> > checkpatch: fix left brace warning >>> > >>> > Using checkpatch.pl with Perl 5.22.0 generates the following >>> > warning: >>> > >>> > Unescaped left brace in regex is deprecated, passed through in >>> > regex; >>> > 5. >>> >>> Indeed. But here the error continues. >>> >>> geyslan@hb ~/Projects/linux $ git log 4e5d56bdf892e -1 >>> commit 4e5d56bdf892e18832a6540b63ebf709966bce2a >>> Author: Eddie Kovsky >>> Date: Wed Sep 9 15:37:52 2015 -0700 >>> >>> checkpatch: fix left brace warning >>> >>> Using checkpatch.pl with Perl 5.22.0 generates the following warning: >>> ... >>> >>> geyslan@hb ~/Projects/linux $ git blame scripts/checkpatch.pl | grep >>> 4e5d56b >>> 3599:4e5d56bdf89 (Eddie Kovsky 2015-09-09 15:37:52 -0700 >>> 3599) !($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) { >>> 4111:4e5d56bdf89 (Eddie Kovsky 2015-09-09 15:37:52 -0700 >>> 4111) if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\){/) || >>> 4112:4e5d56bdf89 (Eddie Kovsky 2015-09-09 15:37:52 -0700 >>> 4112) $line =~ /do\{/) { >>> 4589:4e5d56bdf89 (Eddie Kovsky 2015-09-09 15:37:52 -0700 >>> 4589) $dstat !~ /^\(\{/ && # ({... >>> >>> It missed some regexes, maybe? >> >> >> Joe, I found the culprit (copy & paste, tabs not preserved): >> >> geyslan@hb ~/Projects/linux $ git diff >> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl >> index d4960f7..3e11a30 100755 >> --- a/scripts/checkpatch.pl >> +++ b/scripts/checkpatch.pl >> @@ -4108,7 +4108,7 @@ sub process { >> ## } >> >> #need space before brace following if, while, etc >> - if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\){/) || >> + if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) || >> $line =~ /do\{/) { >> if (ERROR("SPACING", >> "space required before the open brace >> '{'\n" . $herecurr) && >> > Suggested-by: Peter Senna Tschudin > Reported-by: Geyslan G. Bem > Joe, do you applied this patch? If not, would I send it? Tks. >> >> >> Do you think that these could be other not treated cases? >> >> geyslan@hb ~/Projects/linux $ grep "{/" scripts/checkpatch.pl >> 1233: $stmt =~ s/^\s*{//; >> 3109: if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln - 1]) && >> $lines[$ctx_ln - 1] =~ /^\+\s*{/) { >> 3160: $s =~ s/^\s*{//; >> 3266: if ($line =~ /^.\s*{/ && >> 3274: $fixedline =~ s/\s*=\s*$/ = {/; >> 3289: if ($path =~ m{//}) { >> 3300: if ($line =~ m{//}) { >> 3412: if ($line =~ >> /^.\s+(?:static\s+|const\s+)?char\s+\*\s*\w+\s*\[\s*\]\s*=\s*\{/) { >> 3598: if (($line=~/$Type\s*$Ident\(.*\).*\s*{/) and >> 3599: !($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) { >> 3617: if ($line =~ /^.\s*{/ && >> 4111: if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) || >> 4112: $line =~ /do\{/) { >> 4116: $fixed[$fixlinenr] =~ s/^(\+.*(?:do|\))){/$1 {/; >> 4588: $dstat !~ /^do\s*{/ && # do {... >> 4589: $dstat !~ /^\(\{/ && # ({... >> 4726: $seen++ if ($block =~ /^\s*{/); >> 4796: if ($block =~ /^\s*\{/) { >> 4801: if ($level == 0 && $block =~ /^\s*\{/ && !$allowed) { >> >> >> >>> >>> >>> -- >>> Regards, >>> >>> Geyslan G. Bem >>> hackingbits.com >> >> >> >> >> -- >> Regards, >> >> Geyslan G. Bem >> hackingbits.com > > > > -- > Regards, > > Geyslan G. Bem > hackingbits.com -- Regards, Geyslan G. Bem hackingbits.com -- 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/