aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Stelmach <[email protected]>2020-12-15 20:44:27 -0800
committerLinus Torvalds <[email protected]>2020-12-15 22:46:17 -0800
commit4104a20646fe20ed5aa9be883eef7340b219f9a8 (patch)
treec92376968d4752798fde25dcaa20ae97e7cb52ab
parent8d0325cc74a31d517b5b4307c8d895c6e81076b7 (diff)
checkpatch: ignore generated CamelCase defines and enum values
Ignore autogenerated CamelCase-like defines and enum values like DRM_MODE_CONNECTOR_Unknown or ETHTOOL_LINK_MODE_Asym_Pause_BIT. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Łukasz Stelmach <[email protected]> Suggested-by: Joe Perches <[email protected]> Acked-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 519da711cb12..6bbc24e66916 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5320,6 +5320,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