From: Joe Perches Date: Wed, 3 Jul 2013 22:05:20 +0000 (-0700) Subject: checkpatch: change CamelCase test and make it --strict X-Git-Tag: upstream/snapshot3+hdmi~4788^2~237 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be79794bc116fc0c264be1a599433c92ec9e34f5;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Cc: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b954de5..f1aad19 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2938,12 +2938,12 @@ sub process { while ($line =~ m{($Constant|$Lval)}g) { my $var = $1; if ($var !~ /$Constant/ && - $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ && + $var =~ /[A-Z][a-z]|[a-z][A-Z]/ && $var !~ /"^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && !defined $camelcase{$var}) { $camelcase{$var} = 1; - WARN("CAMELCASE", - "Avoid CamelCase: <$var>\n" . $herecurr); + CHK("CAMELCASE", + "Avoid CamelCase: <$var>\n" . $herecurr); } }