Messages in this thread Patch in this message | | | Subject | [PATCH] checkpatch: Find CamelCase definitions of struct/union/enum | From | Joe Perches <> | Date | Tue, 24 Sep 2013 11:38:54 -0700 |
| |
Checkpatch doesn't currently find CamelCase definitions of structs, unions or enums.
Add that ability.
Signed-off-by: Joe Perches <joe@perches.com> --- scripts/checkpatch.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c03e427..3d51710 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -442,8 +442,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; } }
| |