checkpatch: Ignore ETHTOOL_LINK_MODE_ enum values
PATCH v2 1/1 checkpatch: Ignore ETHTOOL_LINK_MODE_ enum values
Since commit 4104a20646 enum values like ETHTOOL_LINK_MODE_Asym_Pause_BIT are ignored. But there are other enums like ETHTOOL_LINK_MODE_1000baseT_Full_BIT, which are not ignored because of the not matching '1000baseT' substring.
Add regex to match all ETHTOOL_LINK_MODE enums.
--- scripts/checkpatch.pl | 2 ++ 1 file changed, 2 insertions(+)
scripts/checkpatch.pl +2 -0
@@ -5783,6 +5783,8 @@ sub process { $var !~ /^(?:[A-Z]+_){1,5}[A-Z]{1,3}[a-z]/ && #Ignore Page<foo> variants $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && +#Ignore ETHTOOL_LINK_MODE_<foo> variants + $var !~ /^ETHTOOL_LINK_MODE_/ && #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_]+)?$/ &&
Signature · 1 line
2.30.2
Joe Perches
maintainerQuoted 6 lines · Gerhard Engleder
Since commit
4104a20646enum values likeETHTOOL_LINK_MODE_Asym_Pause_BITare ignored. But there are other enums likeETHTOOL_LINK_MODE_1000baseT_Full_BIT, which are not ignored because of the not matching '1000baseT' substring.Add regex to match all
ETHTOOL_LINK_MODEenums.
[]
scripts/checkpatch.pl
Quoted 1 line
scripts/checkpatch.pl +0
-0
[]
scripts/checkpatch.pl sub process { · line 5790
Quoted 9 lines
scripts/checkpatch.pl +2
-0@@ -5783,6 +5783,8 @@ sub process { $var !~ /^(?:[A-Z]+_){1,5}[A-Z]{1,3}[a-z]/ && #Ignore Page<foo> variants $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && +#Ignore ETHTOOL_LINK_MODE_<foo> variants + $var !~ /^ETHTOOL_LINK_MODE_/ && #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_]+)?$/ &&
These ETHTOOL enums also exist but are caught by the SI style variants test
ETHTOOL_A_CABLE_PULSE_mVETHTOOL_A_CABLE_AMPLITUDE_mV
So I guess it's OK. Thanks.
Quoted 22 lines · Joe Perches
Quoted 6 lines · Gerhard Engleder
Since commit
4104a20646enum values likeETHTOOL_LINK_MODE_Asym_Pause_BITare ignored. But there are other enums likeETHTOOL_LINK_MODE_1000baseT_Full_BIT, which are not ignored because of the not matching '1000baseT' substring.Add regex to match all
ETHTOOL_LINK_MODEenums.[]
scripts/checkpatch.pl
Quoted 1 line
scripts/checkpatch.pl +0
-0[]
scripts/checkpatch.pl sub process { · line 5790
Quoted 9 lines
scripts/checkpatch.pl +2
-0@@ -5783,6 +5783,8 @@ sub process { $var !~ /^(?:[A-Z]+_){1,5}[A-Z]{1,3}[a-z]/ && #Ignore Page<foo> variants $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && +#Ignore ETHTOOL_LINK_MODE_<foo> variants + $var !~ /^ETHTOOL_LINK_MODE_/ && #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_]+)?$/ &&These ETHTOOL enums also exist but are caught by the SI style variants test
Quoted 4 lines
ETHTOOL_A_CABLE_PULSE_mVETHTOOL_A_CABLE_AMPLITUDE_mVSo I guess it's OK. Thanks.
Did I miss to do something to get this merged? Shall I post it again?
Gerhard