diff options
author | Joe Perches <joe@perches.com> | 2013-11-12 18:10:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:24 -0500 |
commit | 11ea516a6c578564a65a352abb08ef558d365946 (patch) | |
tree | b9373f23d089a5c762ee72c52cd9c3e1d4e11222 /scripts/checkpatch.pl | |
parent | 066687279ccf5e9e935f7780c4b311d18ebaf977 (diff) |
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>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 5 |
1 files changed, 3 insertions, 2 deletions
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 { | |||
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 | } |