History

checkpatch: find CamelCase definitions of struct/union/enum

Checkpatch doesn't currently find CamelCase definitions of structs, unions or enums. Add that ability.

Joe Perches committed 13 years ago

Commit 11ea5161 parent 06668721 file · +3 −2Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+3−2
@@ -443,8 +443,9 @@ sub seed_camelcase_file { · 442 unmodified lines
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 }