Skip to content
Commit a64b44ea authored by Sam Ravnborg's avatar Sam Ravnborg Committed by Michal Marek
Browse files

kconfig: fix tristate choice with minimal config



If a minimal config did not specify the value
of all choice values, the resulting configuration
could have wrong values.

Consider following example:
config M
        def_bool y
        option modules
choice
        prompt "choice list"
config A
        tristate "a"
config B
	tristate "b"
endchoice

With a defconfig like this:
CONFIG_M=y
CONFIG_A=y

The resulting configuration would have

    CONFIG_A=m

which was unexpected.

The problem was not not all choice values were set and thus
kconfig calculated a wrong value.

The fix is to set all choice values when we
read a defconfig files.

conf_set_all_new_symbols() is refactored such that
random choice values are now handled by a dedicated function.
And new choice values are set by set_all_choice_values().

This was not the minimal fix, but the fix that resulted
in the most readable code.

Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Reported-by: default avatarArve Hjønnevåg <arve@android.com>
Tested-by: default avatarArve Hjønnevåg <arve@android.com>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent 801690ca
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment