summaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorŁukasz Stelmach <l.stelmach@samsung.com>2020-12-16 05:44:27 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2020-12-16 07:46:17 +0100
commit4104a20646fe20ed5aa9be883eef7340b219f9a8 (patch)
treec92376968d4752798fde25dcaa20ae97e7cb52ab /scripts/checkpatch.pl
parentcheckpatch: fix false positives in REPEATED_WORD warning (diff)
downloadlinux-4104a20646fe20ed5aa9be883eef7340b219f9a8.tar.xz
linux-4104a20646fe20ed5aa9be883eef7340b219f9a8.zip
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/20201022184916.7904-1-l.stelmach@samsung.com Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com> Suggested-by: Joe Perches <joe@perches.com> Acked-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-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