[PATCH v2] checkpatch: Ignore ETHTOOL_LINK_MODE_ enum values

From: Gerhard Engleder
Date: Wed Jan 04 2023 - 15:16:44 EST


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.

Signed-off-by: Gerhard Engleder <gerhard@xxxxxxxxxxxxxxxxxxxxx>
---
scripts/checkpatch.pl | 2 ++
1 file changed, 2 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 78cc595b98ce..38659f22e54d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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_]+)?$/ &&
--
2.30.2