diff options
author | Joe Perches <joe@perches.com> | 2013-07-03 18:05:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:07:43 -0400 |
commit | be79794bc116fc0c264be1a599433c92ec9e34f5 (patch) | |
tree | 55d91938fbfec0094630021274bc97c8a095b1c5 /scripts/checkpatch.pl | |
parent | 64df3071a97f20767f63b88c573791691a855b5c (diff) |
checkpatch: change CamelCase test and make it --strict
Do not bleat a message on nominally acceptable CamelCase uses that are
separated by an _ like drm_core_has_MTRR.
CamelCase tests are also a bit noisy against certain types of code
acceptable to some kernel developers.
Make the test applicable only with --strict.
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.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 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b954de58304f..f1aad19b475c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2938,12 +2938,12 @@ sub process { | |||
2938 | while ($line =~ m{($Constant|$Lval)}g) { | 2938 | while ($line =~ m{($Constant|$Lval)}g) { |
2939 | my $var = $1; | 2939 | my $var = $1; |
2940 | if ($var !~ /$Constant/ && | 2940 | if ($var !~ /$Constant/ && |
2941 | $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ && | 2941 | $var =~ /[A-Z][a-z]|[a-z][A-Z]/ && |
2942 | $var !~ /"^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && | 2942 | $var !~ /"^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && |
2943 | !defined $camelcase{$var}) { | 2943 | !defined $camelcase{$var}) { |
2944 | $camelcase{$var} = 1; | 2944 | $camelcase{$var} = 1; |
2945 | WARN("CAMELCASE", | 2945 | CHK("CAMELCASE", |
2946 | "Avoid CamelCase: <$var>\n" . $herecurr); | 2946 | "Avoid CamelCase: <$var>\n" . $herecurr); |
2947 | } | 2947 | } |
2948 | } | 2948 | } |
2949 | 2949 | ||