History

kconfig: remove SYMBOL_NO_WRITE flag

This flag is set to symbols that are not intended to be written to the .config file. Since commit b75b0a819af9 ("kconfig: change defconfig_list option to environment variable"), SYMBOL_NO_WRITE is only set to choices. Therefore, (sym->flags & SYMBOL_NO_WRITE) is equivalent to sym_is_choice(sym). This flag is no longer necessary.

Masahiro Yamada committed 2 years ago

Commit a7c79cf1 parent aba09155 files · +4 −8Browse files

Showing the changes to scripts (5 of 5 files). Show all

Unified · Split

5 files
  1. scripts/kconfig/confdata.c +2 −2
  2. scripts/kconfig/expr.h +0 −1
  3. scripts/kconfig/gconf.c +0 −2
  4. scripts/kconfig/parser.y +1 −1
  5. scripts/kconfig/symbol.c +1 −2
scripts/kconfig/confdata.c+2−2
@@ -502,7 +502,7 @@ int conf_read(const char *name) · 501 unmodified lines
502502
503503 for_all_symbols(sym) {
504504 sym_calc_value(sym);
505− if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE))
505+ if (sym_is_choice(sym))
506506 continue;
507507 if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) {
508508 /* check that calculated value agrees with saved value */
@@ -1007,7 +1007,7 @@ static int conf_touch_deps(void) · 498 unmodified lines
10071007
10081008 for_all_symbols(sym) {
10091009 sym_calc_value(sym);
1010− if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name)
1010+ if (sym_is_choice(sym))
10111011 continue;
10121012 if (sym->flags & SYMBOL_WRITE) {
10131013 if (sym->flags & SYMBOL_DEF_AUTO) {
scripts/kconfig/expr.h+0−1
@@ -135,7 +135,6 @@ struct symbol { · 134 unmodified lines
135135 #define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */
136136 #define SYMBOL_CHANGED 0x0400 /* ? */
137137 #define SYMBOL_WRITTEN 0x0800 /* track info to avoid double-write to .config */
138−#define SYMBOL_NO_WRITE 0x1000 /* Symbol for internal use only; it will not be written */
139138 #define SYMBOL_CHECKED 0x2000 /* used during dependency checking */
140139 #define SYMBOL_WARNED 0x8000 /* warning has been issued */
141140
scripts/kconfig/gconf.c+0−2
@@ -91,8 +91,6 @@ static const char *dbg_sym_flags(int val) · 90 unmodified lines
9191 strcat(buf, "write/");
9292 if (val & SYMBOL_CHANGED)
9393 strcat(buf, "changed/");
94− if (val & SYMBOL_NO_WRITE)
95− strcat(buf, "no_write/");
9694
9795 buf[strlen(buf) - 1] = '\0';
9896
scripts/kconfig/parser.y+1−1
@@ -222,7 +222,7 @@ config_option: T_MODULES T_EOL · 221 unmodified lines
222222 choice: T_CHOICE T_EOL
223223 {
224224 struct symbol *sym = sym_lookup(NULL, 0);
225− sym->flags |= SYMBOL_NO_WRITE;
225+
226226 menu_add_entry(sym);
227227 menu_add_expr(P_CHOICE, NULL, NULL);
228228 printd(DEBUG_PARSE, "%s:%d:choice\n", cur_filename, cur_lineno);
scripts/kconfig/symbol.c+1−2
@@ -466,10 +466,9 @@ void sym_calc_value(struct symbol *sym) · 465 unmodified lines
466466 if (sym->flags & SYMBOL_CHANGED)
467467 sym_set_changed(choice_sym);
468468 }
469− }
470469
471− if (sym->flags & SYMBOL_NO_WRITE)
472470 sym->flags &= ~SYMBOL_WRITE;
471+ }
473472
474473 if (sym->flags & SYMBOL_NEED_SET_CHOICE_VALUES)
475474 set_all_choice_values(sym);