From: Andy Whitcroft Date: Fri, 23 Mar 2012 22:02:17 +0000 (-0700) Subject: checkpatch: catch [ ... ] usage when not at the beginning of definition X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=daebc534ac15f991961a5bb433e515988220e9bf;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git checkpatch: catch [ ... ] usage when not at the beginning of definition Handle the [ A ... B ] form deeper into a definition, for example: static const unsigned char pci_irq_swizzle[2][PCI_MAX_DEVICES] = { {0, 0, 0, 0, 0, 0, 0, 27, 27, [9 ... PCI_MAX_DEVICES - 1] = 0 }, {0, 0, 0, 0, 0, 0, 0, 29, 29, [9 ... PCI_MAX_DEVICES - 1] = 0 }, }; Reported-by: Marek Vasut Signed-off-by: Andy Whitcroft Cc: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 0ee37bfdfd68..061c28e7bcfa 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2391,7 +2391,7 @@ sub process { my ($where, $prefix) = ($-[1], $1); if ($prefix !~ /$Type\s+$/ && ($where != 0 || $prefix !~ /^.\s+$/) && - $prefix !~ /{\s+$/) { + $prefix !~ /[{,]\s+$/) { ERROR("BRACKET_SPACE", "space prohibited before open square bracket '['\n" . $herecurr); }