From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXsFu-0003cs-Er for qemu-devel@nongnu.org; Fri, 04 Sep 2015 10:46:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXsFq-0007F2-5r for qemu-devel@nongnu.org; Fri, 04 Sep 2015 10:46:18 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:37464) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXsFp-0007Ew-Vf for qemu-devel@nongnu.org; Fri, 04 Sep 2015 10:46:14 -0400 From: Bastian Koppelmann Date: Fri, 4 Sep 2015 16:45:59 +0200 Message-Id: <1441377959-27604-1-git-send-email-kbastian@mail.uni-paderborn.de> Subject: [Qemu-devel] [PATCH] checkpatch: Perl 5.22 deprecation fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: blauwirbel@gmail.com Perl 5.22 has deprecated unescaped { inside a regexp, resulting in warnings: Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\#\s*define.*do\s{ <-- HERE / at scripts/checkpatch.pl line 3523. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\(.*\){ <-- HERE / at scripts/checkpatch.pl line 4035. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/do{ <-- HERE / at scripts/checkpatch.pl line 4036. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\({ <-- HERE / at scripts/checkpatch.pl line 4483. A fix in kernel can be found here: https://lkml.org/lkml/2015/7/8/1049. Since we diverged a bit from the kernel, I only fixed the warnings I could find. Signed-off-by: Bastian Koppelmann --- scripts/checkpatch.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 7f0aae9..6b129e9 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1936,8 +1936,8 @@ 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=~/}/)) { + if (($line=~/$Type\s*$Ident\(.*\).*\s\{/) and + !($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) { ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr); } @@ -2091,7 +2091,7 @@ sub process { # not required when having a single },{ on one line } elsif ($op eq ',') { if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/ && - ($elements[$n] . $elements[$n + 2]) !~ " *}{") { + ($elements[$n] . $elements[$n + 2]) !~ " *}\\{") { ERROR("space required after that '$op' $at\n" . $hereptr); } @@ -2211,8 +2211,8 @@ sub process { ## } #need space before brace following if, while, etc - if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) || - $line =~ /do{/) { + if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) || + $line =~ /do\{/) { ERROR("space required before the open brace '{'\n" . $herecurr); } -- 2.5.1