Re: [PATCH 1/3] checkpatch: add Kconfig 'default n' test

From: Joe Perches
Date: Thu Apr 21 2016 - 13:16:59 EST


On Thu, 2016-04-21 at 21:28 +0800, Yingjoe Chen wrote:
> If a Kconfig config option doesn't specify 'default', the default
> will be n. Adding 'default n' is unnecessary.
>
> Add a test to warn about this.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -2600,6 +2600,13 @@ sub process {
>        "Use of boolean is deprecated, please use bool instead.\n" . $herecurr);
>   }
>  
> +# discourage the use of default n
> + if ($realfile =~ /Kconfig/ &&
> +     $line =~ /^\+\s*\bdefault\b\s*n\s*$/) {

maybe line =~ /^\+\s*default\s+n/i

Also, there are some oddities like:

arch/mips/cavium-octeon/Kconfig:        default "n"

and a dozen or so uses like

default n if <foo>