summaryrefslogtreecommitdiff
path: root/util/lint
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2016-04-11 00:52:01 +0200
committerMartin Roth <martinroth@google.com>2016-04-22 17:24:17 +0200
commitebef00faf650c7e72da3fdaa0d3ed1fff2e7dce8 (patch)
treef084a3da3598dbfb24b6b2067dffd1efb4ac242f /util/lint
parentf790672f2daf36dd361e184ef01ebdd5950a609c (diff)
lint/checkpatch.pl: escape \{ in perl regex to fix warnings
Fix warnings: Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\#\s*define.*do\s{ <-- HERE / at util/lint/checkpatch.pl line 3261. marked by <-- HERE in m/\(.*\){ <-- HERE / at util/lint/checkpatch.pl line 3750. marked by <-- HERE in m/do{ <-- HERE / at util/lint/checkpatch.pl line 3751. marked by <-- HERE in m/^\({ <-- HERE / at util/lint/checkpatch.pl line 4194. Change-Id: If0c1f07a16df9e6cd1c1393a31af8b8ea6a66b01 Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Reviewed-on: https://review.coreboot.org/14310 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/lint')
-rwxr-xr-xutil/lint/checkpatch.pl10
1 files changed, 5 insertions, 5 deletions
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl
index 894e5d7685..3a4b8be455 100755
--- a/util/lint/checkpatch.pl
+++ b/util/lint/checkpatch.pl
@@ -3258,7 +3258,7 @@ 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=~/}/)) {
+ !($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) {
if (ERROR("OPEN_BRACE",
"open brace '{' following function declarations go on the next line\n" . $herecurr) &&
$fix) {
@@ -3747,8 +3747,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) {
@@ -4190,8 +4190,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*$//;