[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHk-=wj6J-iqrCr_7oLDCbS8qXQ69EF=nPLWmvBiDmgdNWZ6KA@mail.gmail.com>
Date: Mon, 18 May 2020 09:49:29 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: David Howells <dhowells@...hat.com>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>,
Masahiro Yamada <masahiroy@...nel.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Next Mailing List <linux-next@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"Jason A. Donenfeld" <Jason@...c4.com>
Subject: Re: How should we handle a bool depending on a tristate?
On Mon, May 18, 2020 at 9:01 AM David Howells <dhowells@...hat.com> wrote:
>
>
> Blech. Yeah. "depends on" doesn't work either. The problem actually lies
> within the Kconfig framework. It doesn't know how to handle a bool depending
> on a tristate.
No problem with Kconfig. It knows exactly how to let a bool depend on
a tristate.
It's just that there are two different kinds of dependencies.
For example, the dependency can be a hard and absolute dependency
(linking doesn't work, or whatever), and then obviously built-in code
cannot be enabled if the thing it depends on is a loadable module.
But the dependency can also be a conceptual one: "This option doesn't
make sense unless that option is set". Then a bool can make sense even
if the other config is a modular one.
And Kconfig can deal with either situation just fine.
Do
depends on XYZ = y
or
depends on XYZ != n
to clarify the choice. One requires a hard dependency, the other
requires that the option just be enabled.
Now, if you just do "depends on XYZ", it allows a bool to be enabled
even for just a module (ie that second case). That makes sense for a
lot of "allow this feature in the module" kind of options, where it
would be pointless to even ask about a boolean feature if the parent
module isn't even enabled.
But that "depends on XYZ=y" is not uncommon. It basically says "this
option makes sense only when built in". Either because it requires it
for linking, or just because it doesn't work or make sense without it.
Linus
Powered by blists - more mailing lists