]> git.dujemihanovic.xyz Git - linux.git/commitdiff
kconfig: m/nconf: remove dead code to display value of bool choice
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 10 May 2024 10:23:22 +0000 (19:23 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Tue, 14 May 2024 14:36:19 +0000 (23:36 +0900)
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.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/mconf.c
scripts/kconfig/nconf.c

index 8de4af43e865d9e9bda8ef7de1aca7a382c14901..90cd59a96aacb4b7ae60598d3eb771c38f15d976 100644 (file)
@@ -525,19 +525,12 @@ static void build_conf(struct menu *menu)
 
                val = sym_get_tristate_value(sym);
                if (sym_is_changeable(sym)) {
-                       switch (type) {
-                       case S_BOOLEAN:
-                               item_make("[%c]", val == no ? ' ' : '*');
-                               break;
-                       case S_TRISTATE:
-                               switch (val) {
-                               case yes: ch = '*'; break;
-                               case mod: ch = 'M'; break;
-                               default:  ch = ' '; break;
-                               }
-                               item_make("<%c>", ch);
-                               break;
+                       switch (val) {
+                       case yes: ch = '*'; break;
+                       case mod: ch = 'M'; break;
+                       default:  ch = ' '; break;
                        }
+                       item_make("<%c>", ch);
                        item_set_tag('t');
                        item_set_data(menu);
                } else {
index bf460233a4cca602f8879c5ec58da77c6e67cbe4..93047cd28f3fd449a8b10195cd40d4a35fb1f5fb 100644 (file)
@@ -826,26 +826,18 @@ static void build_conf(struct menu *menu)
 
                val = sym_get_tristate_value(sym);
                if (sym_is_changeable(sym)) {
-                       switch (type) {
-                       case S_BOOLEAN:
-                               item_make(menu, 't', "[%c]",
-                                               val == no ? ' ' : '*');
+                       switch (val) {
+                       case yes:
+                               ch = '*';
                                break;
-                       case S_TRISTATE:
-                               switch (val) {
-                               case yes:
-                                       ch = '*';
-                                       break;
-                               case mod:
-                                       ch = 'M';
-                                       break;
-                               default:
-                                       ch = ' ';
-                                       break;
-                               }
-                               item_make(menu, 't', "<%c>", ch);
+                       case mod:
+                               ch = 'M';
+                               break;
+                       default:
+                               ch = ' ';
                                break;
                        }
+                       item_make(menu, 't', "<%c>", ch);
                } else {
                        item_make(menu, def_menu ? 't' : ':', "   ");
                }