From 11ea516a6c578564a65a352abb08ef558d365946 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 12 Nov 2013 15:10:08 -0800 Subject: 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 Signed-off-by: Linus Torvalds --- scripts/checkpatch.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 42567bc..fcc74fe7 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; } } -- cgit v1.1