Skip to content

Commit

Permalink
kconfig: move conf_rewrite_mod_or_yes() to conf.c
Browse files Browse the repository at this point in the history
This function is only used in conf.c.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
Masahiro Yamada committed Mar 25, 2021
1 parent 9a3c3bc commit 15e68d0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
15 changes: 15 additions & 0 deletions scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,21 @@ static void set_randconfig_seed(void)
srand(seed);
}

static void conf_rewrite_mod_or_yes(enum conf_def_mode mode)
{
struct symbol *sym;
int i;
tristate old_val = (mode == def_y2m) ? yes : mod;
tristate new_val = (mode == def_y2m) ? mod : yes;

for_all_symbols(i, sym) {
if (sym_get_type(sym) == S_TRISTATE &&
sym->def[S_DEF_USER].tri == old_val)
sym->def[S_DEF_USER].tri = new_val;
}
sym_clear_all_valid();
}

static int conf_askvalue(struct symbol *sym, const char *def)
{
if (!sym_has_value(sym))
Expand Down
15 changes: 0 additions & 15 deletions scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1322,18 +1322,3 @@ bool conf_set_all_new_symbols(enum conf_def_mode mode)

return has_changed;
}

void conf_rewrite_mod_or_yes(enum conf_def_mode mode)
{
struct symbol *sym;
int i;
tristate old_val = (mode == def_y2m) ? yes : mod;
tristate new_val = (mode == def_y2m) ? mod : yes;

for_all_symbols(i, sym) {
if (sym_get_type(sym) == S_TRISTATE &&
sym->def[S_DEF_USER].tri == old_val)
sym->def[S_DEF_USER].tri = new_val;
}
sym_clear_all_valid();
}
1 change: 0 additions & 1 deletion scripts/kconfig/lkc.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const char *conf_get_configname(void);
void sym_set_change_count(int count);
void sym_add_change_count(int count);
bool conf_set_all_new_symbols(enum conf_def_mode mode);
void conf_rewrite_mod_or_yes(enum conf_def_mode mode);
void set_all_choice_values(struct symbol *csym);

/* confdata.c and expr.c */
Expand Down

0 comments on commit 15e68d0

Please sign in to comment.