diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2021-03-14 04:48:29 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2021-03-25 13:35:29 +0900 |
commit | 15e68d09458f1b417f3129674b89ff91a1070f15 (patch) | |
tree | de5ea8c21e0ec4561cf922ea74d4624e428d1add /scripts/kconfig/conf.c | |
parent | 9a3c3bc820be102f8bb1ca0e9700633d5b3aeb1f (diff) |
kconfig: move conf_rewrite_mod_or_yes() to conf.c
This function is only used in conf.c.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/kconfig/conf.c')
-rw-r--r-- | scripts/kconfig/conf.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 42d35da86604..89c9ba83f9e7 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -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)) |