From: Joe Perches Date: Tue, 5 Nov 2013 05:56:54 +0000 (+1100) Subject: checkpatch: find CamelCase definitions of struct/union/enum X-Git-Tag: next-20131105~2^2~106 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=31e95546fa0cc3b24c1c7714f3ec98869d7d022b;p=karo-tx-linux.git 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 Signed-off-by: Andrew Morton --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 42567bcd66b2..fcc74fe7b4d9 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -443,8 +443,9 @@ sub seed_camelcase_file { next if ($line !~ /(?:[A-Z][a-z]|[a-z][A-Z])/); if ($line =~ /^[ \t]*(?:#[ \t]*define|typedef\s+$Type)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)/) { $camelcase{$1} = 1; - } - elsif ($line =~ /^\s*$Declare\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[\(\[,;]/) { + } elsif ($line =~ /^\s*$Declare\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[\(\[,;]/) { + $camelcase{$1} = 1; + } elsif ($line =~ /^\s*(?:union|struct|enum)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[;\{]/) { $camelcase{$1} = 1; } }