History

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 6a1215888e23 ("kconfig: remove 'optional' property support"). Remove the dead code.

Masahiro Yamada committed 2 years ago

Commit cc3e4e51 parent e89b4612 files · +14 −29Browse files

Unified · Split

2 files
  1. scripts/kconfig/mconf.c +5 −12
  2. scripts/kconfig/nconf.c +9 −17
scripts/kconfig/mconf.c+5−12
@@ -525,19 +525,12 @@ static void build_conf(struct menu *menu) · 524 unmodified lines
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+9−17
@@ -826,26 +826,18 @@ static void build_conf(struct menu *menu) · 825 unmodified lines
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 }