Skip to content

Commit cc3e4e5

Browse files
committed
kconfig: m/nconf: remove dead code to display value of bool choice
Previously, optional bool choices met the following conditions simultaneously: - sym_is_choice(sym) - sym_is_changeable(sym) - type == S_BOOLEAN It no longer occurs since 6a12158 ("kconfig: remove 'optional' property support"). Remove the dead code. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent e89b461 commit cc3e4e5

File tree

2 files changed

+14
-29
lines changed

2 files changed

+14
-29
lines changed

scripts/kconfig/mconf.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -525,19 +525,12 @@ static void build_conf(struct menu *menu)
525525

526526
val = sym_get_tristate_value(sym);
527527
if (sym_is_changeable(sym)) {
528-
switch (type) {
529-
case S_BOOLEAN:
530-
item_make("[%c]", val == no ? ' ' : '*');
531-
break;
532-
case S_TRISTATE:
533-
switch (val) {
534-
case yes: ch = '*'; break;
535-
case mod: ch = 'M'; break;
536-
default: ch = ' '; break;
537-
}
538-
item_make("<%c>", ch);
539-
break;
528+
switch (val) {
529+
case yes: ch = '*'; break;
530+
case mod: ch = 'M'; break;
531+
default: ch = ' '; break;
540532
}
533+
item_make("<%c>", ch);
541534
item_set_tag('t');
542535
item_set_data(menu);
543536
} else {

scripts/kconfig/nconf.c

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -826,26 +826,18 @@ static void build_conf(struct menu *menu)
826826

827827
val = sym_get_tristate_value(sym);
828828
if (sym_is_changeable(sym)) {
829-
switch (type) {
830-
case S_BOOLEAN:
831-
item_make(menu, 't', "[%c]",
832-
val == no ? ' ' : '*');
829+
switch (val) {
830+
case yes:
831+
ch = '*';
833832
break;
834-
case S_TRISTATE:
835-
switch (val) {
836-
case yes:
837-
ch = '*';
838-
break;
839-
case mod:
840-
ch = 'M';
841-
break;
842-
default:
843-
ch = ' ';
844-
break;
845-
}
846-
item_make(menu, 't', "<%c>", ch);
833+
case mod:
834+
ch = 'M';
835+
break;
836+
default:
837+
ch = ' ';
847838
break;
848839
}
840+
item_make(menu, 't', "<%c>", ch);
849841
} else {
850842
item_make(menu, def_menu ? 't' : ':', " ");
851843
}

0 commit comments

Comments
 (0)