From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0844C433E6 for ; Tue, 5 Jan 2021 10:49:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C9822255F for ; Tue, 5 Jan 2021 10:49:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729376AbhAEKtw (ORCPT ); Tue, 5 Jan 2021 05:49:52 -0500 Received: from smtprelay0217.hostedemail.com ([216.40.44.217]:54944 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728947AbhAEKtv (ORCPT ); Tue, 5 Jan 2021 05:49:51 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 3089818225E0E; Tue, 5 Jan 2021 10:49:10 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: grip88_2400adf274d8 X-Filterd-Recvd-Size: 2242 Received: from [192.168.1.159] (unknown [47.151.137.21]) (Authenticated sender: joe@perches.com) by omf10.hostedemail.com (Postfix) with ESMTPA; Tue, 5 Jan 2021 10:49:08 +0000 (UTC) Message-ID: <120df949b3071bdde9c554451130d736eb1fa60c.camel@perches.com> Subject: Re: [PATCH] checkpatch: fix unescaped left braces From: Joe Perches To: David Laight , Dwaipayan Ray Cc: "linux-kernel-mentees@lists.linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "lukas.bulwahn@gmail.com" Date: Tue, 05 Jan 2021 02:49:07 -0800 In-Reply-To: <027501cb2506426d9c05adf56d002781@AcuMS.aculab.com> References: <20210105093507.29297-1-dwaipayanray1@gmail.com> <027501cb2506426d9c05adf56d002781@AcuMS.aculab.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2021-01-05 at 10:35 +0000, David Laight wrote: > From: Joe Perches > > Sent: 05 January 2021 10:01 > > > > On Tue, 2021-01-05 at 15:05 +0530, Dwaipayan Ray wrote: > > > Perl 5.22 onwards require that "A literal "{" should now be > > > escaped in a pattern". > > Sounds like a good reason to never use perl :-) > > > Not quite correct. > > > > > checkpatch contains several literal "{". Fix such instances > > > by preceding them with a backslash. > > > > Not all literal left braces need to be escaped. > > https://www.perlmonks.org/?node_id=1191981 > > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > > [] > > > @@ -2036,7 +2036,7 @@ sub annotate_values { > > >   print "ASSIGN($1)\n" if ($dbg_values > 1); > > >   $type = 'N'; > > > > > > > > > - } elsif ($cur =~/^(;|{|})/) { > > > + } elsif ($cur =~ /^(;|\{|\})/) { > > isn't (;|{|}) much the same as [;{}] ?? Yes, but without the capture, so /^([;{}])/ would be the same. I presume the | style was used for consistency with other uses in the same block. Andy Whitcroft wrote that bit a long time ago.