From: Heinrich Schuchardt Date: Tue, 10 Apr 2018 23:34:14 +0000 (-0700) Subject: checkpatch: allow space between colon and bracket X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=38dca988bb208e66d6fdb6346f7266f3d2d1a8a4;p=linux.git checkpatch: allow space between colon and bracket Allow a space between a colon and subsequent opening bracket. This sequence may occur in inline assembler statements like asm( "ldr %[out], [%[in]]\n\t" : [out] "=r" (ret) : [in] "r" (addr) ); Link: http://lkml.kernel.org/r/20180403191655.23700-1-xypron.glpk@gmx.de Signed-off-by: Heinrich Schuchardt Acked-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 5deee8bd0baeb..eb534d48140e2 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4089,7 +4089,7 @@ sub process { 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) {