summaryrefslogtreecommitdiff
path: root/kconfig/confdata.c
diff options
context:
space:
mode:
authorChris Packham <judge.packham@gmail.com>2020-12-10 06:53:19 (GMT)
committerChris Packham <judge.packham@gmail.com>2021-02-02 07:06:32 (GMT)
commit3bf9edb36c5f1ea9715de1a2a556390540398077 (patch)
tree7ba753be014eec77fae4fabe30dd8148b4c4c4bb /kconfig/confdata.c
parentacce58834d83602b5c97cb01f04c9f540e40792b (diff)
kconfig: Sync with upstream v5.6
This commit introduces the following upstream changes: 089b7d890f97 kconfig: Invalidate all symbols after changing to y or m. 5f2fb52fac15 kbuild: rename hostprogs-y/always to hostprogs/always-y c8fb7d7e48d1 kconfig: fix broken dependency in randconfig-generated .config ba82f52e2287 kconfig: fix an "implicit declaration of function" warning a9609686042b kconfig: fix nesting of symbol help text 3460d0bc256a kconfig: distinguish between dependencies and visibility in help text edda15f21974 kconfig: list all definitions of a symbol in help text 89b9060987d9 kconfig: Add yes2modconfig and mod2yesconfig targets. c8138a57bbd1 kconfig: use $(PERL) in Makefile 1d1352373ebc kconfig: fix too deep indentation in Makefile 68f0d62746bc kconfig: localmodconfig: fix indentation for closing brace 5edcef8454a4 kconfig: localmodconfig: remove unused $config adf7c5bd0674 kconfig: squash prop_alloc() into menu_add_prop() 6397d96ba5a5 kconfig: remove sym from struct property 2ffeef615b5e kconfig: remove 'prompt' argument from menu_add_prop() 024352ff8d69 kconfig: move prompt handling to menu_add_prompt() from menu_add_prop() 1be6e791383a kconfig: remove 'prompt' symbol 801b27db4638 kconfig: drop T_WORD from the RHS of 'prompt' symbol de026ca9152c kconfig: use parent->dep as the parentdep of 'menu' f64048a20b0c kconfig: remove the rootmenu check in menu_add_prop() 8b41fc4454e3 kbuild: create modules.builtin without Makefile.modbuiltin or tristate.conf Signed-off-by: Chris Packham <judge.packham@gmail.com>
Diffstat (limited to 'kconfig/confdata.c')
-rw-r--r--kconfig/confdata.c62
1 files changed, 18 insertions, 44 deletions
diff --git a/kconfig/confdata.c b/kconfig/confdata.c
index 3569d2d..a39d93e 100644
--- a/kconfig/confdata.c
+++ b/kconfig/confdata.c
@@ -710,25 +710,6 @@ static struct conf_printer header_printer_cb =
.print_comment = header_print_comment,
};
-/*
- * Tristate printer
- *
- * This printer is used when generating the `include/config/tristate.conf' file.
- */
-static void
-tristate_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
-{
-
- if (sym->type == S_TRISTATE && *value != 'n')
- fprintf(fp, "%s%s=%c\n", CONFIG_, sym->name, (char)toupper(*value));
-}
-
-static struct conf_printer tristate_printer_cb =
-{
- .print_symbol = tristate_print_symbol,
- .print_comment = kconfig_print_comment,
-};
-
static void conf_write_symbol(FILE *fp, struct symbol *sym,
struct conf_printer *printer, void *printer_arg)
{
@@ -1062,7 +1043,7 @@ int conf_write_autoconf(int overwrite)
struct symbol *sym;
const char *name;
const char *autoconf_name = conf_get_autoconfig_name();
- FILE *out, *tristate, *out_h;
+ FILE *out, *out_h;
int i;
if (!overwrite && is_present(autoconf_name))
@@ -1077,23 +1058,13 @@ int conf_write_autoconf(int overwrite)
if (!out)
return 1;
- tristate = fopen(".tmpconfig_tristate", "w");
- if (!tristate) {
- fclose(out);
- return 1;
- }
-
out_h = fopen(".tmpconfig.h", "w");
if (!out_h) {
fclose(out);
- fclose(tristate);
return 1;
}
conf_write_heading(out, &kconfig_printer_cb, NULL);
-
- conf_write_heading(tristate, &tristate_printer_cb, NULL);
-
conf_write_heading(out_h, &header_printer_cb, NULL);
for_all_symbols(i, sym) {
@@ -1101,15 +1072,11 @@ int conf_write_autoconf(int overwrite)
if (!(sym->flags & SYMBOL_WRITE) || !sym->name)
continue;
- /* write symbol to auto.conf, tristate and header files */
+ /* write symbols to auto.conf and autoconf.h */
conf_write_symbol(out, sym, &kconfig_printer_cb, (void *)1);
-
- conf_write_symbol(tristate, sym, &tristate_printer_cb, (void *)1);
-
conf_write_symbol(out_h, sym, &header_printer_cb, NULL);
}
fclose(out);
- fclose(tristate);
fclose(out_h);
name = getenv("KCONFIG_AUTOHEADER");
@@ -1120,14 +1087,6 @@ int conf_write_autoconf(int overwrite)
if (rename(".tmpconfig.h", name))
return 1;
- name = getenv("KCONFIG_TRISTATE");
- if (!name)
- name = "include/config/tristate.conf";
- if (make_parent_dir(name))
- return 1;
- if (rename(".tmpconfig_tristate", name))
- return 1;
-
if (make_parent_dir(autoconf_name))
return 1;
/*
@@ -1353,7 +1312,7 @@ bool conf_set_all_new_symbols(enum conf_def_mode mode)
sym_calc_value(csym);
if (mode == def_random)
- has_changed = randomize_choice_values(csym);
+ has_changed |= randomize_choice_values(csym);
else {
set_all_choice_values(csym);
has_changed = true;
@@ -1362,3 +1321,18 @@ 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();
+}