Commit 9034de1d authored by Cyril Bur's avatar Cyril Bur Committed by Greg Kroah-Hartman

checkpatch: silence perl 5.26.0 unescaped left brace warnings

commit 8d81ae05 upstream.

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/20170607060135.17384-1-cyrilbur@gmail.comSigned-off-by: default avatarCyril Bur <cyrilbur@gmail.com>
Acked-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 44c1a9e2
...@@ -2985,7 +2985,7 @@ sub process { ...@@ -2985,7 +2985,7 @@ sub process {
$fixedline =~ s/\s*=\s*$/ = {/; $fixedline =~ s/\s*=\s*$/ = {/;
fix_insert_line($fixlinenr, $fixedline); fix_insert_line($fixlinenr, $fixedline);
$fixedline = $line; $fixedline = $line;
$fixedline =~ s/^(.\s*){\s*/$1/; $fixedline =~ s/^(.\s*)\{\s*/$1/;
fix_insert_line($fixlinenr, $fixedline); fix_insert_line($fixlinenr, $fixedline);
} }
} }
...@@ -3301,7 +3301,7 @@ sub process { ...@@ -3301,7 +3301,7 @@ sub process {
my $fixedline = rtrim($prevrawline) . " {"; my $fixedline = rtrim($prevrawline) . " {";
fix_insert_line($fixlinenr, $fixedline); fix_insert_line($fixlinenr, $fixedline);
$fixedline = $rawline; $fixedline = $rawline;
$fixedline =~ s/^(.\s*){\s*/$1\t/; $fixedline =~ s/^(.\s*)\{\s*/$1\t/;
if ($fixedline !~ /^\+\s*$/) { if ($fixedline !~ /^\+\s*$/) {
fix_insert_line($fixlinenr, $fixedline); fix_insert_line($fixlinenr, $fixedline);
} }
...@@ -3748,7 +3748,7 @@ sub process { ...@@ -3748,7 +3748,7 @@ sub process {
if (ERROR("SPACING", if (ERROR("SPACING",
"space required before the open brace '{'\n" . $herecurr) && "space required before the open brace '{'\n" . $herecurr) &&
$fix) { $fix) {
$fixed[$fixlinenr] =~ s/^(\+.*(?:do|\))){/$1 {/; $fixed[$fixlinenr] =~ s/^(\+.*(?:do|\)))\{/$1 {/;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment