[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1574906800-19901-1-git-send-email-krzk@kernel.org>
Date: Thu, 28 Nov 2019 03:06:40 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>,
linux-kernel@...r.kernel.org
Cc: Jani Nikula <jani.nikula@...ux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Krzysztof Kozlowski <krzk@...nel.org>
Subject: [PATCH] checkpatch: Look for Kconfig indentation errors
Kconfig should be indented with one tab for first level and tab+2 spaces
for second level. There are many mixups of this so add a checkpatch
rule.
Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
---
scripts/checkpatch.pl | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e41f4adcc1be..875e862cf076 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3046,6 +3046,13 @@ sub process {
"Use of boolean is deprecated, please use bool instead.\n" . $herecurr);
}
+# Kconfig has special indentation
+ if ($realfile =~ /Kconfig/ &&
+ ($rawline =~ /^\+ +\t* *[a-zA-Z-]/) || ($rawline =~ /^\+\t( | )[a-zA-Z-]/)) {
+ WARN("CONFIG_INDENTATION",
+ "Kconfig uses one tab indentation, optionally followed by two spaces.\n" . $herecurr);
+ }
+
if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) &&
($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) {
my $flag = $1;
--
2.7.4
Powered by blists - more mailing lists