Browse Source

[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".
pull/180/head
Piotr Esden-Tempski 12 years ago
parent
commit
66b9d658bb
  1. 4
      scripts/checkpatch.pl

4
scripts/checkpatch.pl

@ -2940,8 +2940,10 @@ sub process {
if ($var !~ /$Constant/ && if ($var !~ /$Constant/ &&
$var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ && $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ &&
$var !~ /"^(?:Clear|Set|TestClear|TestSet|)Page[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; $camelcase{$var} = 1;
#print "Camelcase line <<$line>>\n";
WARN("CAMELCASE", WARN("CAMELCASE",
"Avoid CamelCase: <$var>\n" . $herecurr); "Avoid CamelCase: <$var>\n" . $herecurr);
} }

Loading…
Cancel
Save