Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752619AbbHEVfA (ORCPT ); Wed, 5 Aug 2015 17:35:00 -0400 Received: from gproxy10-pub.mail.unifiedlayer.com ([69.89.20.226]:51055 "HELO gproxy10-pub.mail.unifiedlayer.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751305AbbHEVe7 (ORCPT ); Wed, 5 Aug 2015 17:34:59 -0400 X-Greylist: delayed 398 seconds by postgrey-1.27 at vger.kernel.org; Wed, 05 Aug 2015 17:34:59 EDT X-Authority-Analysis: v=2.1 cv=OJm0g0qB c=1 sm=1 tr=0 a=PkLafpyMt2xwRD+PMJrZ3Q==:117 a=PkLafpyMt2xwRD+PMJrZ3Q==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=ptNznvi-AAAA:8 a=a-6OF32toJAA:10 a=kj9zAlcOel0A:10 a=fztpppUj2ZoA:10 a=Xwexni91U_8A:10 a=uRRa74qj2VoA:10 a=KSihe0nwYjyfxiN22jQA:9 a=CjuIK1q_8ugA:10 Date: Wed, 5 Aug 2015 15:28:26 -0600 From: Eddie Kovsky To: Andy Whitcroft , Joe Perches , linux-kernel@vger.kernel.org Subject: [PATCH] checkpatch: Fix left brace warning Message-ID: <20150805212826.GA22730@athena.Home> Mail-Followup-To: Eddie Kovsky , Andy Whitcroft , Joe Perches , linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23+102 (2ca89bed6448) (2014-03-12) X-Identified-User: {1650:box492.bluehost.com:edkovsky:edkovsky.org} {sentby:smtp auth 65.102.196.57 authed with ewk+edkovsky.org} Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2028 Lines: 53 Using checkpatch.pl with Perl 5.22.0 generates the following warning: Unescaped left brace in regex is deprecated, passed through in regex; This patch fixes the warnings by escaping occurrences of the left brace inside the regular expression. Signed-off-by: Eddie Kovsky --- scripts/checkpatch.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 50693f52d57c..a38fa70ce694 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3547,7 +3547,7 @@ sub process { # function brace can't be on same line, except for #defines of do while, # or if closed on same line if (($line=~/$Type\s*$Ident\(.*\).*\s*{/) and - !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) { + !($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) { if (ERROR("OPEN_BRACE", "open brace '{' following function declarations go on the next line\n" . $herecurr) && $fix) { @@ -4059,8 +4059,8 @@ sub process { ## } #need space before brace following if, while, etc - if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) || - $line =~ /do{/) { + if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\){/) || + $line =~ /do\{/) { if (ERROR("SPACING", "space required before the open brace '{'\n" . $herecurr) && $fix) { @@ -4507,7 +4507,7 @@ sub process { $dstat !~ /^for\s*$Constant$/ && # for (...) $dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ && # for (...) bar() $dstat !~ /^do\s*{/ && # do {... - $dstat !~ /^\({/ && # ({... + $dstat !~ /^\(\{/ && # ({... $ctx !~ /^.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/) { $ctx =~ s/\n*$//; -- 2.5.0 -- 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/