aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-11-12 15:10:08 -0800
committerStepan Moskovchenko <stepanm@codeaurora.org>2014-10-10 15:45:23 -0700
commitaa86dac95b3e96e23460a0830c08eda04a7ba969 (patch)
tree64a83ab028886af63fd84dd82a3c5c1ce7b0df2f /scripts
parentfdf2683723c72cd1b29a0218ad69c5695a86927f (diff)
downloadqcom-msm-v3.10-aa86dac95b3e96e23460a0830c08eda04a7ba969.tar.gz
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 <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: 11ea516a6c578564a65a352abb08ef558d365946 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 42567bcd66b..fcc74fe7b4d 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;
}
}