diff options
author | Geyslan G. Bem <geyslan@gmail.com> | 2016-03-15 17:58:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-15 19:55:16 -0400 |
commit | 6b8c69e4384b0bcf1936c2137804840212daaf69 (patch) | |
tree | f6661ee36fa66d25e1a21c9612ddbb1ff59e0601 | |
parent | 207a8e8465f91dc5ab12151ee36db3d509a4928a (diff) |
checkpatch: fix another left brace warning
This patch escapes a regex that uses left brace.
Using checkpatch.pl with Perl 5.22.0 generates the warning: "Unescaped
left brace in regex is deprecated, passed through in regex;"
Comment from regcomp.c in Perl source: "Currently we don't warn when the
lbrace is at the start of a construct. This catches it in the middle of
a literal string, or when it's the first thing after something like
"\b"."
This works as a complement to 4e5d56bd ("checkpatch: fix left brace
warning").
Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Peter Senna Tschudin <peter.senna@gmail.com>
Cc: Eddie Kovsky <ewk@edkovsky.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b7f44b2c4334..c64e6044051e 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -4132,7 +4132,7 @@ sub process { | |||
4132 | ## } | 4132 | ## } |
4133 | 4133 | ||
4134 | #need space before brace following if, while, etc | 4134 | #need space before brace following if, while, etc |
4135 | if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\){/) || | 4135 | if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) || |
4136 | $line =~ /do\{/) { | 4136 | $line =~ /do\{/) { |
4137 | if (ERROR("SPACING", | 4137 | if (ERROR("SPACING", |
4138 | "space required before the open brace '{'\n" . $herecurr) && | 4138 | "space required before the open brace '{'\n" . $herecurr) && |