Skip to content

Commit

Permalink
checkpatch: possible types -- else cannot start a type
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Andy Whitcroft authored and torvalds committed Sep 22, 2009
1 parent fc0d8d9 commit 463f286
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 463f286

Please sign in to comment.