mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org, Andy Whitcroft <apw@canonical.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] checkpatch: warn about using CONFIG_EXPERIMENTAL
Date: Mon, 12 Nov 2012 15:06:23 -0800	[thread overview]
Message-ID: <1352761583.18715.16.camel@joe-AO722> (raw)
In-Reply-To: <20121112225019.GA23718@www.outflux.net>

On Mon, 2012-11-12 at 14:50 -0800, Kees Cook wrote:
> This config item has not carried much meaning for a while now and is
> almost always enabled by default. As agreed during the Linux kernel
> summit, it is being removed.  This will discourage future addition of
> CONFIG_EXPERIMENTAL while it is being phased out.

You should also cc Andrew Morton (cc'd)

> Cc: Andy Whitcroft <apw@canonical.com>
> Cc: Joe Perches <joe@perches.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  scripts/checkpatch.pl |   17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index f18750e..41e364b 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1757,6 +1757,15 @@ sub process {
>  			#print "is_start<$is_start> is_end<$is_end> length<$length>\n";
>  		}
>  
> +# discourage the addition of CONFIG_EXPERIMENTAL in Kconfig.
> +		if ($realfile =~ /Kconfig/ &&
> +		    $line =~ /.\s*depends on\s+.*\bEXPERIMENTAL\b/) {

This is after the deleted lines check so this won't trigger
on deleted lines.

> +			WARN("CONFIG_EXPERIMENTAL",
> +			     "Use of CONFIG_EXPERIMENTAL is deprecated. " +
> +			     "For alternatives, see " +
> +			     "https://lkml.org/lkml/2012/10/23/580\n");

I'd much prefer this be on a single line and not using the +
string operator as that style is not currently used in checkpatch.

> +		}
> +
>  		if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) &&
>  		    ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) {
>  			my $flag = $1;
> @@ -1912,6 +1921,14 @@ sub process {
>  # check we are in a valid C source file if not then ignore this hunk
>  		next if ($realfile !~ /\.(h|c)$/);
>  
> +# discourage the addition of CONFIG_EXPERIMENTAL in #if(def).
> +		if ($line =~ /^\+\s*\#\s*if.*\bCONFIG_EXPERIMENTAL\b/) {

Same as previous reply just a few minutes ago

There are many config uses like:
        #if defined(CONFIG_FOO)
and
        #if defined CONFIG_FOO || defined CONFIG_BAR

so I think any line that has this specific config option is suspect.
> +			WARN("CONFIG_EXPERIMENTAL",
> +			     "Use of CONFIG_EXPERIMENTAL is deprecated. " +
> +			     "For alternatives, see " +
> +			     "https://lkml.org/lkml/2012/10/23/580\n");
> +		}




  reply	other threads:[~2012-11-12 23:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12 22:50 Kees Cook
2012-11-12 23:06 ` Joe Perches [this message]
2012-11-12 23:11   ` Kees Cook
2012-11-12 23:19     ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1352761583.18715.16.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®