summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2009-09-22 02:04:34 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-22 16:17:47 +0200
commit463f28648586721c2191130c9b3c27589dcc11a0 (patch)
tree6b9ae0d46a17cd4cd904168e5e818ef68b6c7a04
parentflex_array: add missing kerneldoc annotations (diff)
downloadlinux-463f28648586721c2191130c9b3c27589dcc11a0.tar.xz
linux-463f28648586721c2191130c9b3c27589dcc11a0.zip
checkpatch: possible types -- else cannot start a type
An else cannot start a type, it would have to be within a block after the else. This can trigger false modifier matching. Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2d5ece798c4c..fd6481649258 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1372,6 +1372,8 @@ sub process {
# Ignore functions being called
} elsif ($s =~ /^.\s*$Ident\s*\(/s) {
+ } elsif ($s =~ /^.\s*else\b/s) {
+
# declarations always start with types
} elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?((?:\s*$Ident)+?)\b(?:\s+$Sparse)?\s*\**\s*(?:$Ident|\(\*[^\)]*\))(?:\s*$Modifier)?\s*(?:;|=|,|\()/s) {
my $type = $1;