From: Andy Whitcroft Date: Tue, 22 Sep 2009 00:04:34 +0000 (-0700) Subject: checkpatch: possible types -- else cannot start a type X-Git-Tag: v2.6.32-rc1~433 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=463f28648586721c2191130c9b3c27589dcc11a0;p=profile%2Fcommon%2Fkernel-common.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 2d5ece7..fd64816 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;