瀏覽代碼

checkpatch: ignore SI unit CamelCase variants like "_uV"

Many existing variable names use SI like variants that should be otherwise
obvious and acceptable.

Whitelist them from the CamelCase message.

Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Phil Carmody <phil.carmody@partner.samsung.com>
Acked-by: Phil Carmody <phil.carmody@partner.samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joe Perches 12 年之前
父節點
當前提交
22735ce857
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      scripts/checkpatch.pl

+ 3 - 0
scripts/checkpatch.pl

@@ -3195,7 +3195,10 @@ sub process {
 #CamelCase
 #CamelCase
 			if ($var !~ /^$Constant$/ &&
 			if ($var !~ /^$Constant$/ &&
 			    $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
 			    $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
+#Ignore Page<foo> variants
 			    $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
 			    $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
+#Ignore SI style variants like nS, mV and dB (ie: max_uV, regulator_min_uA_show)
+			    $var !~ /^(?:[a-z_]*?)_?[a-z][A-Z](?:_[a-z_]+)?$/ &&
 			    !defined $camelcase{$var}) {
 			    !defined $camelcase{$var}) {
 				$camelcase{$var} = 1;
 				$camelcase{$var} = 1;
 				CHK("CAMELCASE",
 				CHK("CAMELCASE",