public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, davem@davemloft.net,
	tony@bakeyournoodle.com, mmarek@suse.cz, lacombar@gmail.com,
	sfr@canb.auug.org.au,
	Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: [PATCH 0/3] RFC v2: strip 15,000 lines from a typical autoconf.h
Date: Thu, 12 Apr 2012 19:46:31 -0400	[thread overview]
Message-ID: <1334274394-13466-1-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <CA+55aFx15+eHNA4LobwiFhe4k94XPTVTLdiBmuR4hDKR5HpWPg@mail.gmail.com>

[Re: [PATCH 0/5] RFC: strip 15,000 lines from a typical autoconf.h] On 12/04/2012 (Thu 12:29) Linus Torvalds wrote:

> On Wed, Apr 11, 2012 at 8:10 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Can we leave the CONFIG_ part in the caller, so they are still grepable, please?
> >
> > So:
> >
> >	#define config_enabled(x)	(__stringify(x)[0] == '1')
> 
> Sure. Except G+ came through, and we now have an even better hack for
> this, that works entirely in the preprocessor.
> 
> That also means that you can use it for static initializers etc, so you can do
> 
>    int some_value = config_enabled(CONFIG_ENABLE_XYZ_BY_DEFAULT);
> 
> Paul, do you want to write the patch to change IS_ENABLED() to use this trick?

Sure -- I've done this in patch #1 of the (now) three patches.

I've dropped all the patches relating to phasing out the users
of IS_ENABLED within C code, since now they should just work.

> 
> Trick courtesy of "comex ." on G+ (please do give him credit even if
> he doesn't seem to use his real name):
> 
>   #define is_set(macro) is_set_(macro)
>   #define macrotest_1 ,
>   #define is_set_(value) is_set__(macrotest_##value)
>   #define is_set__(comma) is_set___(comma 1, 0)
>   #define is_set___(_, v, ...) v
> 
> and now "is_set(CONFIG_xyzzy)" works, and gives either 1 or 0 directly
> in the preprocessor.
> 
> Obviously the names have to be changed here (let's not use
> "macrotest_1" - make it something more internal), but the concept is
> solid, and I would actually suggest having this as a generic "is this
> macro set to 1" helper first, and then implement IS_ENABLED() in terms
> of that.

Hopefully the names I've chosen are OK.  Please have a look.

Thanks,
Paul.

> 
> My likee.
> 
>                        Linus

Paul Gortmaker (3):
  kconfig: fix IS_ENABLED to not require all options to be defined
  Revert "kconfig: fix __enabled_ macros definition for invisible and
    un-selected symbols"
  kconfig: delete last traces of __enabled_ from autoconf.h

 include/linux/kconfig.h    |   22 ++++++++++++++++++----
 scripts/kconfig/confdata.c |   38 ++------------------------------------
 2 files changed, 20 insertions(+), 40 deletions(-)

-- 
1.7.9.1


  reply	other threads:[~2012-04-12 23:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11 23:50 [PATCH 0/5] RFC: strip 15,000 lines from a typical autoconf.h Paul Gortmaker
2012-04-11 23:50 ` [PATCH 1/5] Revert "mm: replace PAGE_MIGRATION with IS_ENABLED(CONFIG_MIGRATION)" Paul Gortmaker
2012-04-12  0:05   ` Andrew Morton
2012-04-11 23:50 ` [PATCH 2/5] ARM: remove C users of IS_ENABLED on THUMB2_KERNEL Paul Gortmaker
2012-04-11 23:50 ` [PATCH 3/5] drivers/net: remove IS_ENABLED usage from wiznet drivers Paul Gortmaker
2012-04-11 23:54   ` David Miller
2012-04-12  0:06     ` Stephen Rothwell
2012-04-12  0:22       ` Stephen Rothwell
2012-04-12 17:15     ` Paul Gortmaker
2012-04-11 23:50 ` [PATCH 4/5] Revert "kconfig: fix __enabled_ macros definition for invisible and un-selected symbols" Paul Gortmaker
2012-04-11 23:50 ` [PATCH 5/5] kconfig: limit IS_ENABLED & similar to CPP usage Paul Gortmaker
2012-04-12  0:04   ` Linus Torvalds
2012-04-12 17:46     ` Paul Gortmaker
2012-04-11 23:58 ` [PATCH 0/5] RFC: strip 15,000 lines from a typical autoconf.h Linus Torvalds
2012-04-12  1:19   ` Linus Torvalds
2012-04-12  1:45     ` Andrew Morton
2012-04-12  1:55       ` Linus Torvalds
2012-04-12  3:10         ` Stephen Rothwell
2012-04-12 19:29           ` Linus Torvalds
2012-04-12 23:46             ` Paul Gortmaker [this message]
2012-04-12 23:46               ` [PATCH 1/3] kconfig: fix IS_ENABLED to not require all options to be defined Paul Gortmaker
2012-04-13 10:31                 ` Dick Streefland
2012-04-12 23:46               ` [PATCH 2/3] Revert "kconfig: fix __enabled_ macros definition for invisible and un-selected symbols" Paul Gortmaker
2012-04-12 23:46               ` [PATCH 3/3] kconfig: delete last traces of __enabled_ from autoconf.h Paul Gortmaker
2012-04-12  9:27     ` [PATCH 0/5] RFC: strip 15,000 lines from a typical autoconf.h Michal Marek

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=1334274394-13466-1-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=lacombar@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=sfr@canb.auug.org.au \
    --cc=tony@bakeyournoodle.com \
    --cc=torvalds@linux-foundation.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