diff options
author | Martin Roth <martinroth@google.com> | 2016-08-29 10:39:30 -0600 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2016-09-15 02:27:28 +0200 |
commit | ab9395f6125aa90a95b0932cb546bd494ef9194a (patch) | |
tree | 407e8a516c1c9f0a4ba77413d16f5f59c4f605db /util/lint | |
parent | 2bf453c70e6df2136abb7b221f32709058b5b4fc (diff) | |
download | coreboot-ab9395f6125aa90a95b0932cb546bd494ef9194a.tar.xz |
lint/checkpatch.pl: Pull in coreboot fixes
This pulls in two fixes that were added to coreboot's checkpatch.pl
script:
- commit 82ef8ada (src/commonlib/lz4_wrapper: Correct inline asm for
unaligned 64-bit copy):
modify checkpatch.pl to ignore spaces before opening brackets when
used in inline assembly.
- commit ebef00fa (lint/checkpatch.pl: escape \{ in perl regex to fix
warnings):
Unescaped left brace in regex is deprecated, passed through in regex;
Change-Id: Ia2c712c5b1bb5f67953a9098b5a076e31e3bd8d3
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16348
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/lint')
-rwxr-xr-x | util/lint/checkpatch.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl index 6750595bd7..eb03bc7f30 100755 --- a/util/lint/checkpatch.pl +++ b/util/lint/checkpatch.pl @@ -3836,11 +3836,12 @@ sub process { # 1. with a type on the left -- int [] a; # 2. at the beginning of a line for slice initialisers -- [0...10] = 5, # 3. inside a curly brace -- = { [0...10] = 5 } +# 4. in an extended asm instruction -- : [r0]"r"(r0) while ($line =~ /(.*?\s)\[/g) { my ($where, $prefix) = ($-[1], $1); if ($prefix !~ /$Type\s+$/ && ($where != 0 || $prefix !~ /^.\s+$/) && - $prefix !~ /[{,]\s+$/) { + $prefix !~ /[{,:]\s+$/) { if (ERROR("BRACKET_SPACE", "space prohibited before open square bracket '['\n" . $herecurr) && $fix) { @@ -4709,7 +4710,7 @@ 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 !~ /^do\s*\{/ && # do {... $dstat !~ /^\(\{/ && # ({... $ctx !~ /^.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/) { |