Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kconfig: remove tristate choice support

I previously submitted a fix for a bug in the choice feature [1], where
I mentioned, "Another (much cleaner) approach would be to remove the
tristate choice support entirely".

There are more issues in the tristate choice feature. For example, you
can observe a couple of bugs in the following test code.

[Test Code]

config MODULES
def_bool y
modules

choice
prompt "tristate choice"
default A

config A
tristate "A"

config B
tristate "B"

endchoice

Bug 1: the 'default' property is not correctly processed

'make alldefconfig' produces:

CONFIG_MODULES=y
# CONFIG_A is not set
# CONFIG_B is not set

However, the correct output should be:

CONFIG_MODULES=y
CONFIG_A=y
# CONFIG_B is not set

The unit test file, scripts/kconfig/tests/choice/alldef_expected_config,
is wrong as well.

Bug 2: choice members never get 'y' with randconfig

For the test code above, the following combinations are possible:

A B
(1) y n
(2) n y
(3) m m
(4) m n
(5) n m
(6) n n

'make randconfig' never produces (1) or (2).

These bugs are fixable, but a more critical problem is the lack of a
sensible syntax to specify the default for the tristate choice.
The default for the choice must be one of the choice members, which
cannot specify any of the patterns (3) through (6) above.

In addition, I have never seen it being used in a useful way.

The following commits removed unnecessary use of tristate choices:

- df8df5e4bc37 ("usb: get rid of 'choice' for legacy gadget drivers")
- bfb57ef0544a ("rapidio: remove choice for enumeration")

This commit removes the tristate choice support entirely, which allows
me to delete a lot of code, making further refactoring easier.

Note:
This includes the revert of commit fa64e5f6a35e ("kconfig/symbol.c:
handle choice_values that depend on 'm' symbols"). It was suspicious
because it did not address the root cause but introduced inconsistency
in visibility between choice members and other symbols.

[1]: https://lore.kernel.org/linux-kbuild/20240427104231.2728905-1-masahiroy@kernel.org/T/#m0a1bb6992581462ceca861b409bb33cb8fd7dbae

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

+44 -324
+2 -9
Documentation/kbuild/kconfig-language.rst
··· 409 409 "endchoice" 410 410 411 411 This defines a choice group and accepts any of the above attributes as 412 - options. A choice can only be of type bool or tristate. If no type is 413 - specified for a choice, its type will be determined by the type of 414 - the first choice element in the group or remain unknown if none of the 415 - choice elements have a type specified, as well. 412 + options. 416 413 417 - While a boolean choice only allows a single config entry to be 418 - selected, a tristate choice also allows any number of config entries 419 - to be set to 'm'. This can be used if multiple drivers for a single 420 - hardware exists and only a single driver can be compiled/loaded into 421 - the kernel, but all drivers can be compiled as modules. 414 + A choice only allows a single config entry to be selected. 422 415 423 416 comment:: 424 417
+6 -50
scripts/kconfig/conf.c
··· 114 114 srand(seed); 115 115 } 116 116 117 - static bool randomize_choice_values(struct symbol *csym) 117 + static void randomize_choice_values(struct symbol *csym) 118 118 { 119 119 struct property *prop; 120 120 struct symbol *sym; 121 121 struct expr *e; 122 122 int cnt, def; 123 - 124 - /* 125 - * If choice is mod then we may have more items selected 126 - * and if no then no-one. 127 - * In both cases stop. 128 - */ 129 - if (csym->curr.tri != yes) 130 - return false; 131 123 132 124 prop = sym_get_choice_prop(csym); 133 125 ··· 149 157 csym->flags |= SYMBOL_DEF_USER; 150 158 /* clear VALID to get value calculated */ 151 159 csym->flags &= ~SYMBOL_VALID; 152 - 153 - return true; 154 160 } 155 161 156 162 enum conf_def_mode { ··· 259 269 260 270 sym_clear_all_valid(); 261 271 262 - /* 263 - * We have different type of choice blocks. 264 - * If curr.tri equals to mod then we can select several 265 - * choice symbols in one block. 266 - * In this case we do nothing. 267 - * If curr.tri equals yes then only one symbol can be 268 - * selected in a choice block and we set it to yes, 269 - * and the rest to no. 270 - */ 271 272 if (mode != def_random) { 272 273 for_all_symbols(csym) { 273 274 if ((sym_is_choice(csym) && !sym_has_value(csym)) || ··· 273 292 274 293 sym_calc_value(csym); 275 294 if (mode == def_random) 276 - has_changed |= randomize_choice_values(csym); 277 - else { 295 + randomize_choice_values(csym); 296 + else 278 297 set_all_choice_values(csym); 279 - has_changed = true; 280 - } 298 + has_changed = true; 281 299 } 282 300 283 301 return has_changed; ··· 434 454 435 455 sym = menu->sym; 436 456 is_new = !sym_has_value(sym); 437 - if (sym_is_changeable(sym)) { 438 - conf_sym(menu); 439 - sym_calc_value(sym); 440 - switch (sym_get_tristate_value(sym)) { 441 - case no: 442 - case mod: 443 - return; 444 - case yes: 445 - break; 446 - } 447 - } else { 448 - switch (sym_get_tristate_value(sym)) { 449 - case no: 450 - return; 451 - case mod: 452 - printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); 453 - return; 454 - case yes: 455 - break; 456 - } 457 - } 458 457 459 458 while (1) { 460 459 int cnt, def; ··· 555 596 556 597 if (sym_is_choice(sym)) { 557 598 conf_choice(menu); 558 - if (sym->curr.tri != mod) 559 - return; 560 - goto conf_childs; 599 + return; 561 600 } 562 601 563 602 switch (sym->type) { ··· 588 631 589 632 sym = menu->sym; 590 633 if (sym && !sym_has_value(sym) && 591 - (sym_is_changeable(sym) || 592 - (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes))) { 634 + (sym_is_changeable(sym) || sym_is_choice(sym))) { 593 635 594 636 switch (input_mode) { 595 637 case listnewconfig:
+3 -14
scripts/kconfig/confdata.c
··· 462 462 463 463 if (sym && sym_is_choice_value(sym)) { 464 464 struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); 465 - switch (sym->def[def].tri) { 466 - case no: 467 - break; 468 - case mod: 469 - if (cs->def[def].tri == yes) { 470 - conf_warning("%s creates inconsistent choice state", sym->name); 471 - cs->flags &= ~def_flags; 472 - } 473 - break; 474 - case yes: 465 + if (sym->def[def].tri == yes) { 475 466 if (cs->def[def].tri != no) 476 467 conf_warning("override: %s changes choice state", sym->name); 477 468 cs->def[def].val = sym; 478 - break; 469 + cs->def[def].tri = yes; 479 470 } 480 - cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri); 481 471 } 482 472 } 483 473 free(line); ··· 796 806 797 807 ds = sym_choice_default(choice->sym); 798 808 if (sym == ds) { 799 - if ((sym->type == S_BOOLEAN) && 800 - sym_get_tristate_value(sym) == yes) 809 + if (sym_get_tristate_value(sym) == yes) 801 810 continue; 802 811 } 803 812 }
+2 -4
scripts/kconfig/gconf.c
··· 1067 1067 row[COL_VALUE] = 1068 1068 g_strdup(menu_get_prompt(def_menu)); 1069 1069 1070 - if (sym_get_type(sym) == S_BOOLEAN) { 1071 - row[COL_BTNVIS] = GINT_TO_POINTER(FALSE); 1072 - return row; 1073 - } 1070 + row[COL_BTNVIS] = GINT_TO_POINTER(FALSE); 1071 + return row; 1074 1072 } 1075 1073 if (sym->flags & SYMBOL_CHOICEVAL) 1076 1074 row[COL_BTNRAD] = GINT_TO_POINTER(TRUE);
+7 -21
scripts/kconfig/mconf.c
··· 523 523 def_menu = child; 524 524 } 525 525 526 - val = sym_get_tristate_value(sym); 527 - if (sym_is_changeable(sym)) { 528 - switch (val) { 529 - case yes: ch = '*'; break; 530 - case mod: ch = 'M'; break; 531 - default: ch = ' '; break; 532 - } 533 - item_make("<%c>", ch); 534 - item_set_tag('t'); 535 - item_set_data(menu); 536 - } else { 537 - item_make(" "); 538 - item_set_tag(def_menu ? 't' : ':'); 539 - item_set_data(menu); 540 - } 526 + item_make(" "); 527 + item_set_tag(def_menu ? 't' : ':'); 528 + item_set_data(menu); 541 529 542 530 item_add_str("%*c%s", indent + 1, ' ', menu_get_prompt(menu)); 543 - if (val == yes) { 544 - if (def_menu) 545 - item_add_str(" (%s) --->", menu_get_prompt(def_menu)); 546 - return; 547 - } 531 + if (def_menu) 532 + item_add_str(" (%s) --->", menu_get_prompt(def_menu)); 533 + return; 548 534 } else { 549 535 if (menu == current_menu) { 550 536 item_make("---%*c%s", indent + 1, ' ', menu_get_prompt(menu)); ··· 800 814 conf(submenu, NULL); 801 815 break; 802 816 case 't': 803 - if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes) 817 + if (sym_is_choice(sym)) 804 818 conf_choice(submenu); 805 819 else if (submenu->prompt->type == P_MENU) 806 820 conf(submenu, NULL);
+2 -29
scripts/kconfig/menu.c
··· 321 321 is_choice = true; 322 322 323 323 if (is_choice) { 324 - if (sym->type == S_UNKNOWN) { 325 - /* find the first choice value to find out choice type */ 326 - current_entry = parent; 327 - for (menu = parent->list; menu; menu = menu->next) { 328 - if (menu->sym && menu->sym->type != S_UNKNOWN) { 329 - menu_set_type(menu->sym->type); 330 - break; 331 - } 332 - } 333 - } 334 - 335 324 /* 336 325 * Use the choice itself as the parent dependency of 337 326 * the contained items. This turns the mode of the ··· 492 503 menu->sym && !sym_is_choice_value(menu->sym)) { 493 504 current_entry = menu; 494 505 menu->sym->flags |= SYMBOL_CHOICEVAL; 495 - /* Non-tristate choice values of tristate choices must 496 - * depend on the choice being set to Y. The choice 497 - * values' dependencies were propagated to their 498 - * properties above, so the change here must be re- 499 - * propagated. 500 - */ 501 - if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) { 502 - basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes); 503 - menu->dep = expr_alloc_and(basedep, menu->dep); 504 - for (prop = menu->sym->prop; prop; prop = prop->next) { 505 - if (prop->menu != menu) 506 - continue; 507 - prop->visible.expr = expr_alloc_and(expr_copy(basedep), 508 - prop->visible.expr); 509 - } 510 - } 511 506 menu_add_symbol(P_CHOICE, sym, NULL); 512 507 prop = sym_get_choice_prop(sym); 513 508 for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr) ··· 551 578 552 579 /* 553 580 * For choices, add a reverse dependency (corresponding to a select) of 554 - * '<visibility> && m'. This prevents the user from setting the choice 581 + * '<visibility> && y'. This prevents the user from setting the choice 555 582 * mode to 'n' when the choice is visible. 556 583 */ 557 584 if (sym && sym_is_choice(sym) && parent->prompt) { 558 585 sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr, 559 586 expr_alloc_and(parent->prompt->visible.expr, 560 - expr_alloc_symbol(&symbol_mod))); 587 + expr_alloc_symbol(&symbol_yes))); 561 588 } 562 589 } 563 590
+5 -23
scripts/kconfig/nconf.c
··· 825 825 } 826 826 827 827 val = sym_get_tristate_value(sym); 828 - if (sym_is_changeable(sym)) { 829 - switch (val) { 830 - case yes: 831 - ch = '*'; 832 - break; 833 - case mod: 834 - ch = 'M'; 835 - break; 836 - default: 837 - ch = ' '; 838 - break; 839 - } 840 - item_make(menu, 't', "<%c>", ch); 841 - } else { 842 - item_make(menu, def_menu ? 't' : ':', " "); 843 - } 828 + item_make(menu, def_menu ? 't' : ':', " "); 844 829 845 830 item_add_str("%*c%s", indent + 1, 846 831 ' ', menu_get_prompt(menu)); 847 - if (val == yes) { 848 - if (def_menu) 849 - item_add_str(" (%s) --->", menu_get_prompt(def_menu)); 850 - return; 851 - } 832 + if (def_menu) 833 + item_add_str(" (%s) --->", menu_get_prompt(def_menu)); 834 + return; 852 835 } else { 853 836 if (menu == current_menu) { 854 837 item_make(menu, ':', ··· 1174 1191 conf(submenu); 1175 1192 break; 1176 1193 case 't': 1177 - if (sym_is_choice(sym) && 1178 - sym_get_tristate_value(sym) == yes) 1194 + if (sym_is_choice(sym)) 1179 1195 conf_choice(submenu); 1180 1196 else if (submenu->prompt && 1181 1197 submenu->prompt->type == P_MENU)
+14 -9
scripts/kconfig/parser.y
··· 90 90 91 91 %type <symbol> nonconst_symbol 92 92 %type <symbol> symbol 93 - %type <type> type logic_type default 93 + %type <type> type default 94 94 %type <expr> expr 95 95 %type <expr> if_expr 96 96 %type <string> end ··· 150 150 if (inside_choice) { 151 151 if (!current_entry->prompt) { 152 152 fprintf(stderr, "%s:%d: error: choice member must have a prompt\n", 153 + current_entry->filename, current_entry->lineno); 154 + yynerrs++; 155 + } 156 + 157 + if (current_entry->sym->type != S_BOOLEAN) { 158 + fprintf(stderr, "%s:%d: error: choice member must be bool\n", 153 159 current_entry->filename, current_entry->lineno); 154 160 yynerrs++; 155 161 } ··· 241 235 242 236 menu_add_entry(sym); 243 237 menu_add_expr(P_CHOICE, NULL, NULL); 238 + menu_set_type(S_BOOLEAN); 239 + 244 240 printd(DEBUG_PARSE, "%s:%d:choice\n", cur_filename, cur_lineno); 245 241 }; 246 242 ··· 285 277 printd(DEBUG_PARSE, "%s:%d:prompt\n", cur_filename, cur_lineno); 286 278 }; 287 279 288 - choice_option: logic_type prompt_stmt_opt T_EOL 280 + choice_option: T_BOOL T_WORD_QUOTE if_expr T_EOL 289 281 { 290 - menu_set_type($1); 291 - printd(DEBUG_PARSE, "%s:%d:type(%u)\n", cur_filename, cur_lineno, $1); 282 + menu_add_prompt(P_PROMPT, $2, $3); 283 + printd(DEBUG_PARSE, "%s:%d:bool\n", cur_filename, cur_lineno); 292 284 }; 293 285 294 286 choice_option: T_DEFAULT nonconst_symbol if_expr T_EOL ··· 298 290 }; 299 291 300 292 type: 301 - logic_type 293 + T_BOOL { $$ = S_BOOLEAN; } 294 + | T_TRISTATE { $$ = S_TRISTATE; } 302 295 | T_INT { $$ = S_INT; } 303 296 | T_HEX { $$ = S_HEX; } 304 297 | T_STRING { $$ = S_STRING; } 305 - 306 - logic_type: 307 - T_BOOL { $$ = S_BOOLEAN; } 308 - | T_TRISTATE { $$ = S_TRISTATE; } 309 298 310 299 default: 311 300 T_DEFAULT { $$ = S_UNKNOWN; }
+1 -1
scripts/kconfig/qconf.cc
··· 147 147 expr = sym_get_tristate_value(sym); 148 148 switch (expr) { 149 149 case yes: 150 - if (sym_is_choice_value(sym) && type == S_BOOLEAN) 150 + if (sym_is_choice_value(sym)) 151 151 setIcon(promptColIdx, choiceYesIcon); 152 152 else 153 153 setIcon(promptColIdx, symbolYesIcon);
+2 -20
scripts/kconfig/symbol.c
··· 44 44 { 45 45 enum symbol_type type = sym->type; 46 46 47 - if (type == S_TRISTATE) { 48 - if (sym_is_choice_value(sym) && sym->visible == yes) 49 - type = S_BOOLEAN; 50 - else if (modules_val == no) 51 - type = S_BOOLEAN; 52 - } 47 + if (type == S_TRISTATE && modules_val == no) 48 + type = S_BOOLEAN; 53 49 return type; 54 50 } 55 51 ··· 204 208 static void sym_calc_visibility(struct symbol *sym) 205 209 { 206 210 struct property *prop; 207 - struct symbol *choice_sym = NULL; 208 211 tristate tri; 209 212 210 213 /* any prompt visible? */ 211 214 tri = no; 212 - 213 - if (sym_is_choice_value(sym)) 214 - choice_sym = prop_get_symbol(sym_get_choice_prop(sym)); 215 - 216 215 for_all_prompts(sym, prop) { 217 216 prop->visible.tri = expr_calc_value(prop->visible.expr); 218 - /* 219 - * Tristate choice_values with visibility 'mod' are 220 - * not visible if the corresponding choice's value is 221 - * 'yes'. 222 - */ 223 - if (choice_sym && sym->type == S_TRISTATE && 224 - prop->visible.tri == mod && choice_sym->curr.tri == yes) 225 - prop->visible.tri = no; 226 - 227 217 tri = EXPR_OR(tri, prop->visible.tri); 228 218 } 229 219 if (tri == mod && (sym->type != S_TRISTATE || modules_val == no))
-17
scripts/kconfig/tests/choice/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 - config MODULES 4 - bool "Enable loadable module support" 5 - modules 6 - default y 7 - 8 3 choice 9 4 prompt "boolean choice" 10 5 default BOOL_CHOICE1 ··· 9 14 10 15 config BOOL_CHOICE1 11 16 bool "choice 1" 12 - 13 - endchoice 14 - 15 - choice 16 - prompt "tristate choice" 17 - default TRI_CHOICE1 18 - 19 - config TRI_CHOICE0 20 - tristate "choice 0" 21 - 22 - config TRI_CHOICE1 23 - tristate "choice 1" 24 17 25 18 endchoice
-10
scripts/kconfig/tests/choice/__init__.py
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 """ 3 3 Basic choice tests. 4 - 5 - The handling of 'choice' is a bit complicated part in Kconfig. 6 - 7 - The behavior of 'y' choice is intuitive. If choice values are tristate, 8 - the choice can be 'm' where each value can be enabled independently. 9 4 """ 10 5 11 6 12 7 def test_oldask0(conf): 13 8 assert conf.oldaskconfig() == 0 14 9 assert conf.stdout_contains('oldask0_expected_stdout') 15 - 16 - 17 - def test_oldask1(conf): 18 - assert conf.oldaskconfig('oldask1_config') == 0 19 - assert conf.stdout_contains('oldask1_expected_stdout') 20 10 21 11 22 12 def test_allyes(conf):
-3
scripts/kconfig/tests/choice/alldef_expected_config
··· 1 - CONFIG_MODULES=y 2 1 # CONFIG_BOOL_CHOICE0 is not set 3 2 CONFIG_BOOL_CHOICE1=y 4 - # CONFIG_TRI_CHOICE0 is not set 5 - # CONFIG_TRI_CHOICE1 is not set
-3
scripts/kconfig/tests/choice/allmod_expected_config
··· 1 - CONFIG_MODULES=y 2 1 # CONFIG_BOOL_CHOICE0 is not set 3 2 CONFIG_BOOL_CHOICE1=y 4 - CONFIG_TRI_CHOICE0=m 5 - CONFIG_TRI_CHOICE1=m
-3
scripts/kconfig/tests/choice/allno_expected_config
··· 1 - # CONFIG_MODULES is not set 2 1 # CONFIG_BOOL_CHOICE0 is not set 3 2 CONFIG_BOOL_CHOICE1=y 4 - # CONFIG_TRI_CHOICE0 is not set 5 - CONFIG_TRI_CHOICE1=y
-3
scripts/kconfig/tests/choice/allyes_expected_config
··· 1 - CONFIG_MODULES=y 2 1 # CONFIG_BOOL_CHOICE0 is not set 3 2 CONFIG_BOOL_CHOICE1=y 4 - # CONFIG_TRI_CHOICE0 is not set 5 - CONFIG_TRI_CHOICE1=y
-4
scripts/kconfig/tests/choice/oldask0_expected_stdout
··· 1 - Enable loadable module support (MODULES) [Y/n/?] (NEW) 2 1 boolean choice 3 2 1. choice 0 (BOOL_CHOICE0) (NEW) 4 3 > 2. choice 1 (BOOL_CHOICE1) (NEW) 5 4 choice[1-2?]: 6 - tristate choice [M/y/?] (NEW) 7 - choice 0 (TRI_CHOICE0) [N/m/?] (NEW) 8 - choice 1 (TRI_CHOICE1) [N/m/?] (NEW)
-1
scripts/kconfig/tests/choice/oldask1_config
··· 1 - # CONFIG_MODULES is not set
-9
scripts/kconfig/tests/choice/oldask1_expected_stdout
··· 1 - Enable loadable module support (MODULES) [N/y/?] 2 - boolean choice 3 - 1. choice 0 (BOOL_CHOICE0) (NEW) 4 - > 2. choice 1 (BOOL_CHOICE1) (NEW) 5 - choice[1-2?]: 6 - tristate choice 7 - 1. choice 0 (TRI_CHOICE0) (NEW) 8 - > 2. choice 1 (TRI_CHOICE1) (NEW) 9 - choice[1-2?]:
-21
scripts/kconfig/tests/choice_value_with_m_dep/Kconfig
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - 3 - config MODULES 4 - def_bool y 5 - modules 6 - 7 - config DEP 8 - tristate 9 - default m 10 - 11 - choice 12 - prompt "Tristate Choice" 13 - 14 - config CHOICE0 15 - tristate "Choice 0" 16 - 17 - config CHOICE1 18 - tristate "Choice 1" 19 - depends on DEP 20 - 21 - endchoice
-16
scripts/kconfig/tests/choice_value_with_m_dep/__init__.py
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - """ 3 - Hide tristate choice values with mod dependency in y choice. 4 - 5 - If tristate choice values depend on symbols set to 'm', they should be 6 - hidden when the choice containing them is changed from 'm' to 'y' 7 - (i.e. exclusive choice). 8 - 9 - Related Linux commit: fa64e5f6a35efd5e77d639125d973077ca506074 10 - """ 11 - 12 - 13 - def test(conf): 14 - assert conf.oldaskconfig('config', 'y') == 0 15 - assert conf.config_contains('expected_config') 16 - assert conf.stdout_contains('expected_stdout')
-2
scripts/kconfig/tests/choice_value_with_m_dep/config
··· 1 - CONFIG_CHOICE0=m 2 - CONFIG_CHOICE1=m
-3
scripts/kconfig/tests/choice_value_with_m_dep/expected_config
··· 1 - CONFIG_MODULES=y 2 - CONFIG_DEP=m 3 - CONFIG_CHOICE0=y
-4
scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout
··· 1 - Tristate Choice [M/y/?] y 2 - Tristate Choice 3 - > 1. Choice 0 (CHOICE0) 4 - choice[1]: 1
-25
scripts/kconfig/tests/inter_choice/Kconfig
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - 3 - config MODULES 4 - def_bool y 5 - modules 6 - 7 - choice 8 - prompt "Choice" 9 - 10 - config CHOICE_VAL0 11 - tristate "Choice 0" 12 - 13 - config CHOIVE_VAL1 14 - tristate "Choice 1" 15 - 16 - endchoice 17 - 18 - choice 19 - prompt "Another choice" 20 - depends on CHOICE_VAL0 21 - 22 - config DUMMY 23 - bool "dummy" 24 - 25 - endchoice
-15
scripts/kconfig/tests/inter_choice/__init__.py
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - """ 3 - Do not affect user-assigned choice value by another choice. 4 - 5 - Handling of state flags for choices is complecated. In old days, 6 - the defconfig result of a choice could be affected by another choice 7 - if those choices interact by 'depends on', 'select', etc. 8 - 9 - Related Linux commit: fbe98bb9ed3dae23e320c6b113e35f129538d14a 10 - """ 11 - 12 - 13 - def test(conf): 14 - assert conf.defconfig('defconfig') == 0 15 - assert conf.config_contains('expected_config')
-1
scripts/kconfig/tests/inter_choice/defconfig
··· 1 - CONFIG_CHOICE_VAL0=y
-4
scripts/kconfig/tests/inter_choice/expected_config
··· 1 - CONFIG_MODULES=y 2 - CONFIG_CHOICE_VAL0=y 3 - # CONFIG_CHOIVE_VAL1 is not set 4 - CONFIG_DUMMY=y