staging: comedi: Capitalize macro name to fix camelcase checkpatch warning
Subsystems (2)
PATCH 1/1 staging: comedi: Capitalize macro name to fix camelcase checkpatch warning
Capitalize RANGE_mA to fix camelcase check warning. Issue reported by checkpatch.pl
--- drivers/staging/comedi/comedidev.h | 2 +- drivers/staging/comedi/drivers/adv_pci1724.c | 4 ++-- drivers/staging/comedi/drivers/dac02.c | 2 +- drivers/staging/comedi/range.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-)
drivers/staging/comedi/comedidev.h +1 -1
@@ -603,7 +603,7 @@ int comedi_check_chanlist(struct comedi_subdevice *s,#define RANGE (a, b) {(a) * 1e6, (b) * 1e6, 0}#define RANGE_ext (a, b) {(a) * 1e6, (b) * 1e6, RF_EXTERNAL} -#define RANGE_mA (a, b) {(a) * 1e6, (b) * 1e6, UNIT_MA} +#define RANGE_MA (a, b) {(a) * 1e6, (b) * 1e6, UNIT_MA}#define RANGE_unitless (a, b) {(a) * 1e6, (b) * 1e6, 0}#define BIP_RANGE (a) {-(a) * 1e6, (a) * 1e6, 0}#define UNI_RANGE (a) {0, (a) * 1e6, 0}
drivers/staging/comedi/drivers/adv_pci1724.c +2 -2
@@ -64,8 +64,8 @@static const struct comedi_lrange adv_pci1724_ao_ranges = {4 , {BIP_RANGE (10 ), -RANGE_mA (0 ,20 ), -RANGE_mA (4 ,20 ), +RANGE_MA (0 ,20 ), +RANGE_MA (4 ,20 ),RANGE_unitless (0 ,1 ) } };
drivers/staging/comedi/drivers/dac02.c +1 -1
@@ -54,7 +54,7 @@ static const struct comedi_lrange das02_ao_ranges = {UNI_RANGE (10 ),BIP_RANGE (5 ),BIP_RANGE (10 ), -RANGE_mA (4 ,20 ), +RANGE_MA (4 ,20 ), RANGE_ext(0, 1) } };
drivers/staging/comedi/range.c +3 -3
@@ -23,11 +23,11 @@ const struct comedi_lrange range_unipolar5 = { 1, {UNI_RANGE(5)} };EXPORT_SYMBOL_GPL (range_unipolar5);const struct comedi_lrange range_unipolar2_5 = {1 , {UNI_RANGE (2.5 )} };EXPORT_SYMBOL_GPL (range_unipolar2_5); -const struct comedi_lrange range_0_20mA = {1 , {RANGE_mA (0 ,20 )} }; +const struct comedi_lrange range_0_20mA = {1 , {RANGE_MA (0 ,20 )} };EXPORT_SYMBOL_GPL (range_0_20mA); -const struct comedi_lrange range_4_20mA = {1 , {RANGE_mA (4 ,20 )} }; +const struct comedi_lrange range_4_20mA = {1 , {RANGE_MA (4 ,20 )} };EXPORT_SYMBOL_GPL (range_4_20mA); -const struct comedi_lrange range_0_32mA = {1 , {RANGE_mA (0 ,32 )} }; +const struct comedi_lrange range_0_32mA = {1 , {RANGE_MA (0 ,32 )} };EXPORT_SYMBOL_GPL (range_0_32mA);const struct comedi_lrange range_unknown = {1 , {{0 ,1000000 , UNIT_none} } };EXPORT_SYMBOL_GPL (range_unknown);
Signature · 1 line
2.21.0
Greg KH
maintainerQuoted 16 lines · Jules Irenge
Capitalize
RANGE_mAto fix camelcase check warning. Issue reported by checkpatch.plSigned-off-by Jules Irenge <[email protected]>--- drivers/staging/comedi/comedidev.h | 2 +- drivers/staging/comedi/drivers/adv_pci1724.c | 4 ++-- drivers/staging/comedi/drivers/dac02.c | 2 +- drivers/staging/comedi/range.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-)drivers/staging/comedi/comedidev.h +0
-0
drivers/staging/comedi/comedidev.h int comedi_check_chanlist(struct comedi_subdevice *s, · line 606
Quoted 5 lines
drivers/staging/comedi/comedidev.h +1
-1@@ -603,7 +603,7 @@ int comedi_check_chanlist(struct comedi_subdevice *s,#define RANGE (a, b) {(a) * 1e6, (b) * 1e6, 0}#define RANGE_ext (a, b) {(a) * 1e6, (b) * 1e6, RF_EXTERNAL} -#define RANGE_mA (a, b) {(a) * 1e6, (b) * 1e6, UNIT_MA} +#define RANGE_MA (a, b) {(a) * 1e6, (b) * 1e6, UNIT_MA}
Did you send this patch twice?
Anyway, this is the units "mA", which needs to be "mA" for obvious reasons. Sorry, checkpatch is wrong in thsi case.
thanks,
greg k-h
Joe Perches
maintainerPATCH 1/1 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.
--- scripts/checkpatch.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +3 -2
@@ -5044,8 +5044,9 @@ sub process { $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_]+)?$/ && +#Ignore SI style variants like nS, mV and dB +#(ie: max_uV, regulator_min_uA_show, RANGE_mA_VALUE) + $var !~ /^(?:[a-z0-9_]*|[A-Z0-9_]*)?_?[a-z][A-Z](?:_[a-z0-9_]+|_[A-Z0-9_]+)?$/ && #Ignore some three character SI units explicitly, like MiB and KHz $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) { while ($var =~ m{($Ident)}g) {
On Sun, Oct 06, 2019 at 07:49:03PM +0100, Jules Irenge wrote:
[mA vs. MA]
Table 5. SI prefixes
Factor Name Symbol
....
10^6 mega M
....
10^-3 milli m
Confusing one for another (especially for electrical units) can be... spectacular. FYI, 1mA is more or less what you get if you lick the terminals of a 9V battery; 1MA is about 30 times the current in typical lightning strike...