History

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.

Joe Perches committed 13 years ago

Commit 22735ce1 parent 786b6321 file · +3 −0Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+3−0
@@ -3195,7 +3195,10 @@ sub process { · 3194 unmodified lines
3195#CamelCase3195#CamelCase
3196 if ($var !~ /^$Constant$/ &&3196 if ($var !~ /^$Constant$/ &&
3197 $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&3197 $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
3198#Ignore Page<foo> variants
3198 $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&3199 $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_]+)?$/ &&
3199 !defined $camelcase{$var}) {3202 !defined $camelcase{$var}) {
3200 $camelcase{$var} = 1;3203 $camelcase{$var} = 1;
3201 CHK("CAMELCASE",3204 CHK("CAMELCASE",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t