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=-9.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3BE29C4742C for ; Mon, 16 Nov 2020 03:43:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 09A8E2225E for ; Mon, 16 Nov 2020 03:43:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbgKPDnW (ORCPT ); Sun, 15 Nov 2020 22:43:22 -0500 Received: from smtprelay0232.hostedemail.com ([216.40.44.232]:36944 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726198AbgKPDnV (ORCPT ); Sun, 15 Nov 2020 22:43:21 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id C36D118029151; Mon, 16 Nov 2020 03:43:20 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: leaf99_1a0628d27325 X-Filterd-Recvd-Size: 2128 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf15.hostedemail.com (Postfix) with ESMTPA; Mon, 16 Nov 2020 03:43:19 +0000 (UTC) Message-ID: Subject: Re: [PATCH] checkpatch: Fix unescaped left brace From: Joe Perches To: Dwaipayan Ray , Andrew Morton Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com Date: Sun, 15 Nov 2020 19:43:18 -0800 In-Reply-To: <20201115202928.81955-1-dwaipayanray1@gmail.com> References: <20201115202928.81955-1-dwaipayanray1@gmail.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 Mon, 2020-11-16 at 01:59 +0530, Dwaipayan Ray wrote: > There is an unescaped left brace in a regex in OPEN_BRACE > check. This throws a runtime error when checkpatch is run > with --fix flag and the OPEN_BRACE check is executed. > > Fix it by escaping the left brace. > > Fixes: 8d1824780f2f ("checkpatch: add --fix option for a couple OPEN_BRACE misuses") > Signed-off-by: Dwaipayan Ray Thanks Dwaipayan. Obviously that code path hasn't been tested in awhile. I think the notice to require an escape for a { was added back in perl 5.16 or so. Acked-by: Joe Perches > --- >  scripts/checkpatch.pl | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 2749f32dffe9..0da6422cd0fd 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -4505,7 +4505,7 @@ sub process { >   $fix) { >   fix_delete_line($fixlinenr, $rawline); >   my $fixed_line = $rawline; > - $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*){(.*)$/; > + $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*)\{(.*)$/; >   my $line1 = $1; >   my $line2 = $2; >   fix_insert_line($fixlinenr, ltrim($line1));