From 66b9d658bb0120eb31a48bd220391135b6935238 Mon Sep 17 00:00:00 2001 From: Piotr Esden-Tempski Date: Fri, 5 Jul 2013 19:45:31 -0700 Subject: [PATCH] [Stylecheck] Accept defines using lower case x. It is considerede CamelCase but we do accept those as it makes the code more readable knowing that the lower case x is a placeholder for a number or letter in the define and the define applies to all "banks", "buffers", "subsystems". --- scripts/checkpatch.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 022db048..5740d1ac 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2940,8 +2940,10 @@ sub process { if ($var !~ /$Constant/ && $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ && $var !~ /"^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && - !defined $camelcase{$var}) { + !defined $camelcase{$var} && + !($line =~ /^[ +-]*#\s*define/ && $var =~ /[A-Z][A-Z0-9_]*x[A-Z0-9_]*\b/)) { $camelcase{$var} = 1; + #print "Camelcase line <<$line>>\n"; WARN("CAMELCASE", "Avoid CamelCase: <$var>\n" . $herecurr); }