Skip to content

Commit 11ea516

Browse files
JoePerchestorvalds
authored andcommitted
checkpatch: find CamelCase definitions of struct/union/enum
Checkpatch doesn't currently find CamelCase definitions of structs, unions or enums. Add that ability. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0666872 commit 11ea516

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/checkpatch.pl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,9 @@ sub seed_camelcase_file {
443443
next if ($line !~ /(?:[A-Z][a-z]|[a-z][A-Z])/);
444444
if ($line =~ /^[ \t]*(?:#[ \t]*define|typedef\s+$Type)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)/) {
445445
$camelcase{$1} = 1;
446-
}
447-
elsif ($line =~ /^\s*$Declare\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[\(\[,;]/) {
446+
} elsif ($line =~ /^\s*$Declare\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[\(\[,;]/) {
447+
$camelcase{$1} = 1;
448+
} elsif ($line =~ /^\s*(?:union|struct|enum)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[;\{]/) {
448449
$camelcase{$1} = 1;
449450
}
450451
}

0 commit comments

Comments
 (0)