diff options
author | Andy Whitcroft <apw@canonical.com> | 2012-03-23 18:02:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 19:58:36 -0400 |
commit | daebc534ac15f991961a5bb433e515988220e9bf (patch) | |
tree | add72230235f44a56111cad80913985ad24aaf6d | |
parent | 11232688ec41a507cdb476fc4e88aff8a3a34c3c (diff) |
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 <marek.vasut@gmail.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
1 files changed, 1 insertions, 1 deletions
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 { | |||
2391 | my ($where, $prefix) = ($-[1], $1); | 2391 | my ($where, $prefix) = ($-[1], $1); |
2392 | if ($prefix !~ /$Type\s+$/ && | 2392 | if ($prefix !~ /$Type\s+$/ && |
2393 | ($where != 0 || $prefix !~ /^.\s+$/) && | 2393 | ($where != 0 || $prefix !~ /^.\s+$/) && |
2394 | $prefix !~ /{\s+$/) { | 2394 | $prefix !~ /[{,]\s+$/) { |
2395 | ERROR("BRACKET_SPACE", | 2395 | ERROR("BRACKET_SPACE", |
2396 | "space prohibited before open square bracket '['\n" . $herecurr); | 2396 | "space prohibited before open square bracket '['\n" . $herecurr); |
2397 | } | 2397 | } |