History

checkpatch: improve ignoring CamelCase SI style variants like mA

Ignore all upper-case variants before and after SI units like mA, mV and uV so uses like RANGE_mA do not emit a CAMELCASE message.

Joe Perches committed 6 years ago

Commit d439e6a1 parent 964975a1 file · +3 −2Browse files

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

Unified · Split

scripts/checkpatch.pl+3−2
@@ -5038,8 +5038,9 @@ sub process { · 5037 unmodified lines
50385038 $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
50395039 #Ignore Page<foo> variants
50405040 $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
5041−#Ignore SI style variants like nS, mV and dB (ie: max_uV, regulator_min_uA_show)
5042− $var !~ /^(?:[a-z_]*?)_?[a-z][A-Z](?:_[a-z_]+)?$/ &&
5041+#Ignore SI style variants like nS, mV and dB
5042+#(ie: max_uV, regulator_min_uA_show, RANGE_mA_VALUE)
5043+ $var !~ /^(?:[a-z0-9_]*|[A-Z0-9_]*)?_?[a-z][A-Z](?:_[a-z0-9_]+|_[A-Z0-9_]+)?$/ &&
50435044 #Ignore some three character SI units explicitly, like MiB and KHz
50445045 $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) {
50455046 while ($var =~ m{($Ident)}g) {

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