[U-Boot] [PATCH] checkpatch.pl: Fix checkpatch.pl warnings with Perl 5.22
Moritz Fischer
moritz.fischer at ettus.com
Thu Sep 3 21:25:35 CEST 2015
This patch fixes a bunch of deprecation warings that show up when using
checkpatch.pl with Perl 5.22.
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 2829.
Unescaped left brace in regex is deprecated, passed through in regex;
marked by <-- HERE in m/\(.*\){ <-- HERE / at
./scripts/checkpatch.pl line 3262.
Unescaped left brace in regex is deprecated, passed through in regex;
marked by <-- HERE in m/do{ <-- HERE / at
./scripts/checkpatch.pl line 3263.
Unescaped left brace in regex is deprecated, passed through in regex;
marked by <-- HERE in m/^\({ <-- HERE / at
./scripts/checkpatch.pl line 3636.
Unescaped left brace in regex is deprecated, passed through in regex;
marked by <-- HERE in m/(?^x:
Signed-off-by: Moritz Fischer <moritz.fischer at ettus.com>
---
scripts/checkpatch.pl | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 74db2e2..3a6b9fa 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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,12 +3259,12 @@ 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) {
- $fixed[$linenr - 1] =~ s/^(\+.*(?:do|\))){/$1 {/;
+ $fixed[$linenr - 1] =~ s/^(\+.*(?:do|\)))\{/$1 {/;
}
}
@@ -3633,7 +3633,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.1
More information about the U-Boot
mailing list