[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a78gnyaz.fsf@intel.com>
Date: Thu, 28 Nov 2019 11:29:56 +0200
From: Jani Nikula <jani.nikula@...ux.intel.com>
To: Krzysztof Kozlowski <krzk@...nel.org>,
Andy Whitcroft <apw@...onical.com>,
Joe Perches <joe@...ches.com>, linux-kernel@...r.kernel.org
Cc: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Krzysztof Kozlowski <krzk@...nel.org>
Subject: Re: [PATCH] checkpatch: Look for Kconfig indentation errors
On Thu, 28 Nov 2019, Krzysztof Kozlowski <krzk@...nel.org> wrote:
> 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>
I agree unifying the indentation is nice, and without something like
this it'll start bitrotting before Krzysztof's done fixing them all... I
think there's been quite a few fixes merged lately.
I approve of the idea, but I'm clueless about the implementation.
BR,
Jani.
> ---
> 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;
--
Jani Nikula, Intel Open Source Graphics Center
Powered by blists - more mailing lists