mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
d533828ef3
When a prompt is followed by "if <expr>", the symbol is configurable when the if-conditional evaluates to true. A typical usage is as follows: menuconfig BLOCK bool "Enable the block layer" if EXPERT default y When EXPERT=n, the prompt is hidden, but this config entry is still active, and BLOCK is set to its default value 'y'. When EXPERT=y, the prompt is shown, making BLOCK a user-configurable option. This usage is common throughout the kernel tree, but it has never worked within a choice block. [Test Code] config EXPERT bool "Allow expert users to modify more options" choice prompt "Choose" if EXPERT config A bool "A" config B bool "B" endchoice [Result] # CONFIG_EXPERT is not set When the prompt is hidden, the choice block should produce the default without asking for the user's preference. Hence, the output should be: # CONFIG_EXPERT is not set CONFIG_A=y # CONFIG_B is not set Removing unnecessary hacks fixes the issue. This commit also changes the behavior of 'select' by choice members. [Test Code 2] config MODULES def_bool y modules config DEP def_tristate m if DEP choice prompt "choose" config A bool "A" select C endchoice config B def_bool y select D endif config C tristate config D tristate The current output is as follows: CONFIG_MODULES=y CONFIG_DEP=m CONFIG_A=y CONFIG_B=y CONFIG_C=y CONFIG_D=m With this commit, the output will be changed as follows: CONFIG_MODULES=y CONFIG_DEP=m CONFIG_A=y CONFIG_B=y CONFIG_C=m CONFIG_D=m CONFIG_C will be changed to 'm' because 'select C' will inherit the dependency on DEP, which is 'm'. This change is aligned with the behavior of 'select' outside a choice block; 'select D' depends on DEP, therefore D is selected by (B && DEP). Note: With this commit, allmodconfig will set CONFIG_USB_ROLE_SWITCH to 'm' instead of 'y'. I did not see any build regression with this change. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> |
||
---|---|---|
.. | ||
lxdialog | ||
tests | ||
.gitignore | ||
array_size.h | ||
conf.c | ||
confdata.c | ||
expr.c | ||
expr.h | ||
gconf-cfg.sh | ||
gconf.c | ||
gconf.glade | ||
hashtable.h | ||
images.c | ||
images.h | ||
internal.h | ||
lexer.l | ||
list_types.h | ||
list.h | ||
lkc_proto.h | ||
lkc.h | ||
Makefile | ||
mconf-cfg.sh | ||
mconf.c | ||
menu.c | ||
merge_config.sh | ||
mnconf-common.c | ||
mnconf-common.h | ||
nconf-cfg.sh | ||
nconf.c | ||
nconf.gui.c | ||
nconf.h | ||
parser.y | ||
preprocess.c | ||
preprocess.h | ||
qconf-cfg.sh | ||
qconf.cc | ||
qconf.h | ||
streamline_config.pl | ||
symbol.c | ||
util.c |