summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorŁukasz Stelmach <l.stelmach@samsung.com>2020-11-09 08:52:36 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2020-11-09 08:52:36 +1100
commita74ad2d1ae3337f76091ca212a1f78c7afd3f944 (patch)
tree78cc223cb1e52a0b9f3aab408c84f6a8dd10e671
parent7766156978413fe8d5d79a06762649de5f1be435 (diff)
downloadlinux-a74ad2d1ae3337f76091ca212a1f78c7afd3f944.tar.gz
linux-a74ad2d1ae3337f76091ca212a1f78c7afd3f944.tar.xz
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: Stephen Rothwell <sfr@canb.auug.org.au>
-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