[PATCH v2] checkpatch: ignore generated CamelCase defines and enum values
From: Łukasz Stelmach
Date: Thu Oct 22 2020 - 14:49:52 EST
Ignore autogenerated CamelCase-like defines and enum values like
DRM_MODE_CONNECTOR_Unknown or ETHTOOL_LINK_MODE_Asym_Pause_BIT.
Syggested-by: Joe Perches <joe@xxxxxxxxxxx>
Signed-off-by: Łukasz Stelmach <l.stelmach@xxxxxxxxxxx>
---
Changes in v2
- use a more general regexp suggested by Joe Perches
scripts/checkpatch.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index fab38b493cef..7e67d565e903 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5295,6 +5295,8 @@ sub process {
#CamelCase
if ($var !~ /^$Constant$/ &&
$var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
+#Ignore some autogenerated defines and enum values
+ $var !~ /^(?:[A-Z]+_){1,5}[A-Z]{1,3}[a-z]/ &&
#Ignore Page<foo> variants
$var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
#Ignore SI style variants like nS, mV and dB
--
2.26.2