Re: select validation (was: Re: [2.6 patch] HID: fix defaultbuilding of all quirky devices)

From: Adrian Bunk
Date: Thu Oct 16 2008 - 15:31:25 EST

On Thu, Oct 16, 2008 at 11:47:55AM -0700, Linus Torvalds wrote:
> On Thu, 16 Oct 2008, Geert Uytterhoeven wrote:
> >
> > Would it be possible for kconfig to check for invalid usage of select?
> >
> > Like you should not use select to enable something that has
> > dependencies. However, that would fail in case both the selector option
> > and the selected option depend on the same.
> Well, at least in theory you may actually want to select something that
> has dependencies, even if you don't want to select the dependencies.
> For example, some feature may be enabled by default on some architecture
> or with some config. Example:
> default y
> depends on EXPERIMENTAL
> depends on !EMBEDDED
> depends on X86
> which is just another way of saying
> default X86 && !EMBEDDED && EXPERIMENTAL

Such constructs without a prompt are for a different usecase than what
you have in mind, there wouldn't be EXPERIMENTAL or EMBEDDED in the
dependencies, this is used for stuff like

config X86_HT
depends on SMP
depends on (X86_32 && !X86_VOYAGER) || X86_64
default y

And that's usually not the kind of symbol that should get selected.

In reality your example would be:

bool "support feature" if EMBEDDED
default y
depends on X86 && EXPERIMENTAL

> and it's still possible that some code wants to do a
> because the dependency isn't a _code_ dependency, it's a default-value
> dependency.

I'd be more concerned about dependencies that are used to make the
kconfig UI better.

Dependencies on options like NETDEV_1000 are not code dependencies.

> Linus



"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at