]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - scripts/checkpatch.pl
checkpatch.pl: fix 'Unescaped left brace in regex is deprecated' warning
[karo-tx-uboot.git] / scripts / checkpatch.pl
index 3fed5e4694f8aec4cd9d074f423f331d142332dc..3e5d99421266f944974100dfe9a92545a667136a 100755 (executable)
@@ -2148,7 +2148,7 @@ sub process {
                                "please, no space before tabs\n" . $herevet) &&
                            $fix) {
                                while ($fixed[$linenr - 1] =~
-                                          s/(^\+.*) {8,8}+\t/$1\t\t/) {}
+                                          s/(^\+.*) {8,8}\t/$1\t\t/) {}
                                while ($fixed[$linenr - 1] =~
                                           s/(^\+.*) +\t/$1\t/) {}
                        }
@@ -2825,8 +2825,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",
                              "open brace '{' following function declarations go on the next line\n" . $herecurr);
                }
@@ -3259,8 +3259,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) {
@@ -3632,8 +3632,8 @@ sub process {
                            $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ &&       # do {...} while (...); // do {...} while (...)
                            $dstat !~ /^for\s*$Constant$/ &&                            # for (...)
                            $dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ &&   # for (...) bar()
-                           $dstat !~ /^do\s*{/ &&                                      # do {...
-                           $dstat !~ /^\({/ &&                                         # ({...
+                           $dstat !~ /^do\s*\{/ &&                                     # do {...
+                           $dstat !~ /^\(\{/ &&                                                # ({...
                            $ctx !~ /^.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/)
                        {
                                $ctx =~ s/\n*$//;