From: rikusw <rikusw@phenix.rootshell.be>
To: linux-kernel@vger.kernel.org
Subject: Subtle Kconfig bug discovered
Date: Sun, 7 Nov 2004 14:01:03 +0100 [thread overview]
Message-ID: <20041107130103.GA9261@phenix.rootshell.be> (raw)
Hi
Here is a sample Kconfig file to show what this is all about.
//----snip----
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
menu "Kconfig problem"
config DOIT
bool "To see what I mean set D and D1 to Y.
config TEST_A
bool "Test A"
default n
help
Top level config
config TEST_B
tristate "Test B"
default n
depends on TEST_A
help
Something depending on A
config TEST_C
bool "Test C"
default n
select TEST_B
help
Something depending on B
config TEST_D
bool "Test D"
default n
select TEST_C
help
Selecting C will cause it to be Y, but what about A and B ??
A and B is in another subsystem,
so D shouldn't know anything about them.
comment "Sugessted solution"
config README
bool "Read Me in help"
help
Should "depends on X" implicitly cause a "select X" ?
When X = 1&2&3 this is easy, but what when X = (1&2)|3 ???
The least LKC could do is to give a warning, if a disabled
option is selected.
I discovered this while working on fb_setup and i810fb.
A = I2C, B = I2C_ALGOBIT, C = I2C_I810 and D = FB_I810_I2C
Have a look at www.rootshell.be/~rikusw
The solution below doesn't require any changes to LKC,
the implicit select will.
config TEST_A1
bool "Test A1"
default n
help
config TEST_B1
tristate "Test B1"
default n
select TEST_A1
help
config TEST_C1
tristate "Test C1"
default n
select TEST_B1
help
If this is bool then B1 will b Y regardless whether D1 is M or Y...
config TEST_D1
tristate "Test D1"
default n
select TEST_C1
# select TEST_B1 - I don't want this because D1 is in another subsystem
# and shouldn't know anything about B1.
help
endmenu
//----snip----
I will be offline for the next 4-5 days bu, but please CC me at:
"rikusw" --> "rootshell.be"
Rikus Wessels
reply other threads:[~2004-11-07 13:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20041107130103.GA9261@phenix.rootshell.be \
--to=rikusw@phenix.rootshell.be \
--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