Skip to content

Commit 8d81ae0

Browse files
cyrilbur-ibmtorvalds
authored andcommitted
checkpatch: silence perl 5.26.0 unescaped left brace warnings
As of perl 5, version 26, subversion 0 (v5.26.0) some new warnings have occurred when running checkpatch. Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^(.\s*){ <-- HERE \s*/ at scripts/checkpatch.pl line 3544. Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^(.\s*){ <-- HERE \s*/ at scripts/checkpatch.pl line 3885. Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^(\+.*(?:do|\))){ <-- HERE / at scripts/checkpatch.pl line 4374. It seems perfectly reasonable to do as the warning suggests and simply escape the left brace in these three locations. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Cyril Bur <[email protected]> Acked-by: Joe Perches <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a0ad759 commit 8d81ae0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/checkpatch.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3555,7 +3555,7 @@ sub process {
35553555
$fixedline =~ s/\s*=\s*$/ = {/;
35563556
fix_insert_line($fixlinenr, $fixedline);
35573557
$fixedline = $line;
3558-
$fixedline =~ s/^(.\s*){\s*/$1/;
3558+
$fixedline =~ s/^(.\s*)\{\s*/$1/;
35593559
fix_insert_line($fixlinenr, $fixedline);
35603560
}
35613561
}
@@ -3896,7 +3896,7 @@ sub process {
38963896
my $fixedline = rtrim($prevrawline) . " {";
38973897
fix_insert_line($fixlinenr, $fixedline);
38983898
$fixedline = $rawline;
3899-
$fixedline =~ s/^(.\s*){\s*/$1\t/;
3899+
$fixedline =~ s/^(.\s*)\{\s*/$1\t/;
39003900
if ($fixedline !~ /^\+\s*$/) {
39013901
fix_insert_line($fixlinenr, $fixedline);
39023902
}
@@ -4385,7 +4385,7 @@ sub process {
43854385
if (ERROR("SPACING",
43864386
"space required before the open brace '{'\n" . $herecurr) &&
43874387
$fix) {
4388-
$fixed[$fixlinenr] =~ s/^(\+.*(?:do|\))){/$1 {/;
4388+
$fixed[$fixlinenr] =~ s/^(\+.*(?:do|\)))\{/$1 {/;
43894389
}
43904390
}
43914391

0 commit comments

Comments
 (0)