linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Michal Marek <mmarek@suse.cz>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Andi Kleen <ak@linux.intel.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	linux-kbuild@vger.kernel.org,
	Linus <torvalds@linux-foundation.org>,
	Li Zefan <lizf@cn.fujitsu.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Vadim Bendebury <vbendeb@google.com>,
	Nir Tzachar <nir.tzachar@gmail.com>,
	Francis Galiegue <fgaliegue@gmail.com>,
	Trevor Keith <tsrk@tsrk.net>, Jiri Kosina <jkosina@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	ppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Cheng Renquan <crquan@gmail.com>
Subject: Re: [RFC][PATCH] kconfig: implement select with values
Date: Tue, 27 Jul 2010 08:45:23 +0200	[thread overview]
Message-ID: <20100727064523.GA25872@merkur.ravnborg.org> (raw)
In-Reply-To: <AANLkTikP3nZd-LionO27vsinjXz=upKbDZeErSD4CAfz@mail.gmail.com>

> 
> Cute.  I didn't know this was possible.  I'll give it a try and see
> how it works for me.  Do override config options also pickup
> select/depends constraints applied by later definitions?  I think that
> would be necessary to kick out warnings when a defconfig selection
> isn't actually achievable.

kconfig allows one to add more properties to a config
symbol by defining the symbol again.

So:
config FOO
	bool
	prompt "foo prompt"
	default y
	help
	  Help text

Is the same as:
config FOO
	bool

config FOO
	prompt "foo prompt"

config FOO
	default y

config FOO
	help
	  help text

The abvoe four lines can be located in different files.

And likewise kconfig allows the same property to be
specified twice or more.

So it is OK to say:

config BAR
	tristate "bar prompt"
	default m
	default y

Here kconfig just picks the first default is see.

And the example in my original mail uses the feature
that we can specify several defaults - and kconfig uses the first.


For choices the same is possible but then you need to use
a named choice - something that no one does today in the kernel.

choice CHOICE_X86_CPU
	default M386

endchoice

Here we change the default to M386 which becomes the
selected if we use "alldefconfig".

[Note: It does not work until we use named choices in arch/x86/Kconfig.cpu]

> 
> > Now in the original suggestion of Linus he used:
> >
> >    KBUILD_KCONFIG=Mykconfig make allnoconfig
> >
> > And "allnoconfig" would make the modified defaults useless.
> >
> > But the soon-to-be-introduced alldefconfig is more sensible.
> >
> > alldefconfig uses default values for everything.
> 
> I basically used defconfig in the prototype that I posted.  I think it
> works well for me, and I've got it integrated into the build targets
> (just like Stephen's earlier patch) without having to do a
> KBUILD_KCONFIG trick.

"defconfig" with an empty file gives same config as "alldefconfig" so
it makes sense. But we wanted to drop the use of defconfig files
in favour of files with Kconfig syntax.
So alldefconfig is just a better fit here.

[The above btw. also makes "savedefconfig" less usefull].

	Sam

      reply	other threads:[~2010-07-27  6:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-19 18:37 [RFC][PATCH] kconfig: implement select with values Stephen Rothwell
2010-07-26 22:17 ` Sam Ravnborg
2010-07-26 22:47   ` Grant Likely
2010-07-27  6:45     ` Sam Ravnborg [this message]

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=20100727064523.GA25872@merkur.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=crquan@gmail.com \
    --cc=fgaliegue@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=jkosina@suse.cz \
    --cc=josh@joshtriplett.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mmarek@suse.cz \
    --cc=nir.tzachar@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.org \
    --cc=tsrk@tsrk.net \
    --cc=vbendeb@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).