qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] checkpatch: Perl 5.22 deprecation fixes


From: Bastian Koppelmann
Subject: [Qemu-devel] [PATCH] checkpatch: Perl 5.22 deprecation fixes
Date: Fri, 4 Sep 2015 16:45:59 +0200

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 <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]