Skip to content

Commit 23a5dfd

Browse files
Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG"
This reverts commit 422c809. It causes more harm than it solves issues. Reported-by: Sedat Dilek <[email protected]> Reported-by: Arnd Bergmann <[email protected]> Signed-off-by: "Yann E. MORIN" <[email protected]> Tested-by: Sedat Dilek <[email protected]> Cc: Sedat Dilek <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Michal Marek <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Stephen Rothwell <[email protected]> Cc: Thomas Petazzoni <[email protected]> Cc: Greg KH <[email protected]>
1 parent e43956e commit 23a5dfd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

scripts/kconfig/confdata.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ int conf_read_simple(const char *name, int def)
288288
for_all_symbols(i, sym) {
289289
sym->flags |= SYMBOL_CHANGED;
290290
sym->flags &= ~(def_flags|SYMBOL_VALID);
291+
if (sym_is_choice(sym))
292+
sym->flags |= def_flags;
291293
switch (sym->type) {
292294
case S_INT:
293295
case S_HEX:
@@ -377,13 +379,13 @@ int conf_read_simple(const char *name, int def)
377379
case mod:
378380
if (cs->def[def].tri == yes) {
379381
conf_warning("%s creates inconsistent choice state", sym->name);
382+
cs->flags &= ~def_flags;
380383
}
381384
break;
382385
case yes:
383386
if (cs->def[def].tri != no)
384387
conf_warning("override: %s changes choice state", sym->name);
385388
cs->def[def].val = sym;
386-
cs->flags |= def_flags;
387389
break;
388390
}
389391
cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri);
@@ -789,8 +791,6 @@ int conf_write(const char *name)
789791
sym_calc_value(sym);
790792
if (!(sym->flags & SYMBOL_WRITE))
791793
goto next;
792-
if (sym_is_choice_value(sym) && !menu_is_visible(menu->parent))
793-
goto next;
794794
sym->flags &= ~SYMBOL_WRITE;
795795

796796
conf_write_symbol(out, sym, &kconfig_printer_cb, NULL);
@@ -1077,7 +1077,6 @@ static void randomize_choice_values(struct symbol *csym)
10771077
else {
10781078
sym->def[S_DEF_USER].tri = no;
10791079
}
1080-
sym->flags &= ~(SYMBOL_VALID);
10811080
}
10821081
csym->flags |= SYMBOL_DEF_USER;
10831082
/* clear VALID to get value calculated */

0 commit comments

Comments
 (0)