From ab9395f6125aa90a95b0932cb546bd494ef9194a Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Mon, 29 Aug 2016 10:39:30 -0600 Subject: 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 Reviewed-on: https://review.coreboot.org/16348 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- util/lint/checkpatch.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util/lint') 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/) { -- cgit v1.2.3