Skip to content

Commit 226ac19

Browse files
committed
kconfig: do not clear SYMBOL_VALID when reading include/config/auto.conf
When conf_read_simple() is called with S_DEF_AUTO, it is meant to read previous symbol values from include/config/auto.conf to determine which include/config/* files should be touched. This process should not modify the current symbol status in any way. However, conf_touch_deps() currently invalidates all symbol values and recalculates them, which is totally unneeded. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 6c3fb0b commit 226ac19

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

scripts/kconfig/confdata.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ int conf_read_simple(const char *name, int def)
385385

386386
def_flags = SYMBOL_DEF << def;
387387
for_all_symbols(sym) {
388-
sym->flags &= ~(def_flags|SYMBOL_VALID);
388+
sym->flags &= ~def_flags;
389389
switch (sym->type) {
390390
case S_INT:
391391
case S_HEX:
@@ -398,7 +398,11 @@ int conf_read_simple(const char *name, int def)
398398
}
399399
}
400400

401-
expr_invalidate_all();
401+
if (def == S_DEF_USER) {
402+
for_all_symbols(sym)
403+
sym->flags &= ~SYMBOL_VALID;
404+
expr_invalidate_all();
405+
}
402406

403407
while (getline_stripped(&line, &line_asize, in) != -1) {
404408
struct menu *choice;
@@ -464,6 +468,9 @@ int conf_read_simple(const char *name, int def)
464468
if (conf_set_sym_val(sym, def, def_flags, val))
465469
continue;
466470

471+
if (def != S_DEF_USER)
472+
continue;
473+
467474
/*
468475
* If this is a choice member, give it the highest priority.
469476
* If conflicting CONFIG options are given from an input file,
@@ -967,10 +974,8 @@ static int conf_touch_deps(void)
967974
depfile_path[depfile_prefix_len] = 0;
968975

969976
conf_read_simple(name, S_DEF_AUTO);
970-
sym_calc_value(modules_sym);
971977

972978
for_all_symbols(sym) {
973-
sym_calc_value(sym);
974979
if (sym_is_choice(sym))
975980
continue;
976981
if (sym->flags & SYMBOL_WRITE) {
@@ -1084,12 +1089,12 @@ int conf_write_autoconf(int overwrite)
10841089
if (ret)
10851090
return -1;
10861091

1087-
if (conf_touch_deps())
1088-
return 1;
1089-
10901092
for_all_symbols(sym)
10911093
sym_calc_value(sym);
10921094

1095+
if (conf_touch_deps())
1096+
return 1;
1097+
10931098
ret = __conf_write_autoconf(conf_get_autoheader_name(),
10941099
print_symbol_for_c,
10951100
&comment_style_c);

0 commit comments

Comments
 (0)