kconfig: change "modules" from sub-option to first-level attributeNow "modules" is the only member of the "option" property.Remove "option", and move "modules" to the top level property.Signed-
kconfig: change "modules" from sub-option to first-level attributeNow "modules" is the only member of the "option" property.Remove "option", and move "modules" to the top level property.Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
show more ...
kconfig: convert to SPDX License IdentifierAll files in lxdialog/ are licensed under GPL-2.0+, and the rest areunder GPL-2.0. I added GPL-2.0 tags to test scripts in tests/.Documentation/process
kconfig: convert to SPDX License IdentifierAll files in lxdialog/ are licensed under GPL-2.0+, and the rest areunder GPL-2.0. I added GPL-2.0 tags to test scripts in tests/.Documentation/process/license-rules.rst does not suggest anythingabout the flex/bison files. Because flex does not accept the C++comment style at the very top of a file, I used the C style forzconf.l, and so for zconf.y for consistency.Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
kconfig: tests: test defconfig when two choices interactCommit fbe98bb9ed3d ("kconfig: Fix defconfig when one choice menuselects options that another choice menu depends on") fixed defconfigwhen
kconfig: tests: test defconfig when two choices interactCommit fbe98bb9ed3d ("kconfig: Fix defconfig when one choice menuselects options that another choice menu depends on") fixed defconfigwhen two choices interact (i.e. calculating the visibility of a choicerequires to calculate another choice).The test code in that commit log was based on the real world example,and complicated. So, I shrunk it down to the following:defconfig.choice:---8<---CONFIG_CHOICE_VAL0=y---8<------8<---config MODULES def_bool y option moduleschoice prompt "Choice"config CHOICE_VAL0 tristate "Choice 0"config CHOICE_VAL1 tristate "Choice 1"endchoicechoice prompt "Another choice" depends on CHOICE_VAL0config DUMMY bool "dummy"endchoice---8<---Prior to commit fbe98bb9ed3d, $ scripts/kconfig/conf --defconfig=defconfig.choice Kconfig.choiceresulted in: CONFIG_MODULES=y CONFIG_CHOICE_VAL0=m # CONFIG_CHOICE_VAL1 is not set CONFIG_DUMMY=ywhere the expected result would be: CONFIG_MODULES=y CONFIG_CHOICE_VAL0=y # CONFIG_CHOICE_VAL1 is not set CONFIG_DUMMY=yRoughly, this weird behavior happened like this:Symbols are calculated a couple of times. First, all symbols arecalculated in conf_read(). The first 'choice' is evaluated to 'y'due to the SYMBOL_DEF_USER flag, but sym_calc_choice() clears itunless all of its choice values are explicitly set by the user.conf_set_all_new_symbols() clears all SYMBOL_VALID flags. Then, onlychoices are calculated. Here, the SYMBOL_DEF_USER for the first choicehas been forgotten, so it is evaluated to 'm'. set_all_choice_values()sets SYMBOL_DEF_USER again to choice symbols.When calculating the second choice, due to 'depends on CHOICE_VAL0',it triggers the calculation of CHOICE_VAL0. As a result, SYMBOL_VALIDis set for CHOICE_VAL0.Symbols except choices get the final chance of re-calculation inconf_write(). In a normal case, CHOICE_VAL0 would be re-calculated,then the first choice would be indirectly re-calculated with theSYMBOL_DEF_USER which has been recalled by set_all_choice_values(),which would be evaluated to 'y'. But, in this case, CHOICE_VAL0 hasalready been marked as SYMBOL_VALID, so this re-calculation does nothappen. Then, =m from the conf_set_all_new_symbols() phase is writtenout to the .config file.Add a unit test for this naive case.Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>