summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-05-07 17:14:50 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2024-05-14 16:36:19 +0200
commit6ba750ddebc90aa97be376e05bc093371934ddce (patch)
tree6350f8684d6c43f3bd96af2661fb6bb1257ae25c /scripts
parentkbuild: use GCOV_PROFILE and KCSAN_SANITIZE in scripts/Makefile.modfinal (diff)
downloadlinux-6ba750ddebc90aa97be376e05bc093371934ddce.tar.xz
linux-6ba750ddebc90aa97be376e05bc093371934ddce.zip
kconfig: gconf: show checkbox for choice correctly
Currently, bool choices have a checkbox, but tristate choices do not. It is opposite. Bool choices should not have a checkbox, as they are fixed to 'y' since commit 6a1215888e23 ("kconfig: remove 'optional' property support"). Tristate choices, however, should have a checkbox to allow users to toggle the value. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/gconf.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 10d602faa51e..cc400ffe6615 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1054,8 +1054,6 @@ static gchar **fill_row(struct menu *menu)
struct symbol *def_sym = sym_get_choice_value(sym);
struct menu *def_menu = NULL;
- row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
-
for (child = menu->list; child; child = child->next) {
if (menu_is_visible(child)
&& child->sym == def_sym)
@@ -1065,6 +1063,11 @@ static gchar **fill_row(struct menu *menu)
if (def_menu)
row[COL_VALUE] =
g_strdup(menu_get_prompt(def_menu));
+
+ if (sym_get_type(sym) == S_BOOLEAN) {
+ row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
+ return row;
+ }
}
if (sym->flags & SYMBOL_CHOICEVAL)
row[COL_BTNRAD] = GINT_TO_POINTER(TRUE);
@@ -1072,11 +1075,6 @@ static gchar **fill_row(struct menu *menu)
stype = sym_get_type(sym);
switch (stype) {
case S_BOOLEAN:
- if (GPOINTER_TO_INT(row[COL_PIXVIS]) == FALSE)
- row[COL_BTNVIS] = GINT_TO_POINTER(TRUE);
- if (sym_is_choice(sym))
- break;
- /* fall through */
case S_TRISTATE:
val = sym_get_tristate_value(sym);
switch (val) {