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/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+3−2
@@ -443,8 +443,9 @@ sub seed_camelcase_file { · 442 unmodified lines
443 next if ($line !~ /(?:[A-Z][a-z]|[a-z][A-Z])/);443 next if ($line !~ /(?:[A-Z][a-z]|[a-z][A-Z])/);
444 if ($line =~ /^[ \t]*(?:#[ \t]*define|typedef\s+$Type)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)/) {444 if ($line =~ /^[ \t]*(?:#[ \t]*define|typedef\s+$Type)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)/) {
445 $camelcase{$1} = 1;445 $camelcase{$1} = 1;
446 }446 } elsif ($line =~ /^\s*$Declare\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[\(\[,;]/) {
447 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*[;\{]/) {
448 $camelcase{$1} = 1;449 $camelcase{$1} = 1;
449 }450 }
450 }451 }