Skip to content

Commit 22735ce

Browse files
JoePerchestorvalds
authored andcommitted
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>
1 parent 786b632 commit 22735ce

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎scripts/checkpatch.pl‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3195,7 +3195,10 @@ sub process {
31953195
#CamelCase
31963196
if ($var !~ /^$Constant$/ &&
31973197
$var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
3198+
#Ignore Page<foo> variants
31983199
$var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
3200+
#Ignore SI style variants like nS, mV and dB (ie: max_uV, regulator_min_uA_show)
3201+
$var !~ /^(?:[a-z_]*?)_?[a-z][A-Z](?:_[a-z_]+)?$/ &&
31993202
!defined $camelcase{$var}) {
32003203
$camelcase{$var} = 1;
32013204
CHK("CAMELCASE",

0 commit comments

Comments
 (0)