Skip to content

Commit

Permalink
checkpatch: ignore SI unit CamelCase variants like "_uV"
Browse files Browse the repository at this point in the history
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 <[email protected]>
Suggested-by: Phil Carmody <[email protected]>
Acked-by: Phil Carmody <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JoePerches authored and torvalds committed Jul 3, 2013
1 parent 786b632 commit 22735ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3195,7 +3195,10 @@ sub process {
#CamelCase
if ($var !~ /^$Constant$/ &&
$var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
#Ignore Page<foo> variants
$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}) {
$camelcase{$var} = 1;
CHK("CAMELCASE",
Expand Down

0 comments on commit 22735ce

Please sign in to comment.