Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit e8fcd915 authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

kconfig: change sym_choice_default() to take the choice menu


Change the argument of sym_choice_default() to ease further cleanups.

Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent cca31837
Branches
Tags
No related merge requests found
...@@ -779,7 +779,7 @@ int conf_write_defconfig(const char *filename) ...@@ -779,7 +779,7 @@ int conf_write_defconfig(const char *filename)
if (choice) { if (choice) {
struct symbol *ds; struct symbol *ds;
ds = sym_choice_default(choice->sym); ds = sym_choice_default(choice);
if (sym == ds && sym_get_tristate_value(sym) == yes) if (sym == ds && sym_get_tristate_value(sym) == yes)
continue; continue;
} }
......
...@@ -109,7 +109,7 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help); ...@@ -109,7 +109,7 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help);
/* symbol.c */ /* symbol.c */
void sym_clear_all_valid(void); void sym_clear_all_valid(void);
struct symbol *sym_choice_default(struct symbol *sym); struct symbol *sym_choice_default(struct menu *choice);
struct symbol *sym_calc_choice(struct menu *choice); struct symbol *sym_calc_choice(struct menu *choice);
struct property *sym_get_range_prop(struct symbol *sym); struct property *sym_get_range_prop(struct symbol *sym);
const char *sym_get_string_default(struct symbol *sym); const char *sym_get_string_default(struct symbol *sym);
......
...@@ -255,14 +255,14 @@ static void sym_calc_visibility(struct symbol *sym) ...@@ -255,14 +255,14 @@ static void sym_calc_visibility(struct symbol *sym)
* Next locate the first visible choice value * Next locate the first visible choice value
* Return NULL if none was found * Return NULL if none was found
*/ */
struct symbol *sym_choice_default(struct symbol *sym) struct symbol *sym_choice_default(struct menu *choice)
{ {
struct symbol *def_sym; struct symbol *def_sym;
struct property *prop; struct property *prop;
struct expr *e; struct expr *e;
/* any of the defaults visible? */ /* any of the defaults visible? */
for_all_defaults(sym, prop) { for_all_defaults(choice->sym, prop) {
prop->visible.tri = expr_calc_value(prop->visible.expr); prop->visible.tri = expr_calc_value(prop->visible.expr);
if (prop->visible.tri == no) if (prop->visible.tri == no)
continue; continue;
...@@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct symbol *sym) ...@@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct symbol *sym)
} }
/* just get the first visible value */ /* just get the first visible value */
prop = sym_get_choice_prop(sym); prop = sym_get_choice_prop(choice->sym);
expr_list_for_each_sym(prop->expr, e, def_sym) expr_list_for_each_sym(prop->expr, e, def_sym)
if (def_sym->visible != no) if (def_sym->visible != no)
return def_sym; return def_sym;
...@@ -312,7 +312,7 @@ struct symbol *sym_calc_choice(struct menu *choice) ...@@ -312,7 +312,7 @@ struct symbol *sym_calc_choice(struct menu *choice)
* explicitly set to 'n'. * explicitly set to 'n'.
*/ */
if (!res) { if (!res) {
res = sym_choice_default(choice->sym); res = sym_choice_default(choice);
if (res && sym_has_value(res) && res->def[S_DEF_USER].tri == no) if (res && sym_has_value(res) && res->def[S_DEF_USER].tri == no)
res = NULL; res = NULL;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment