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
502 502
503 for_all_symbols(sym) {503 for_all_symbols(sym) {
504 sym_calc_value(sym);504 sym_calc_value(sym);
505 if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE))505 if (sym_is_choice(sym))
506 continue;506 continue;
507 if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) {507 if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) {
508 /* check that calculated value agrees with saved value */508 /* check that calculated value agrees with saved value */
@@ -1007,7 +1007,7 @@ static int conf_touch_deps(void) · 498 unmodified lines
1007 1007
1008 for_all_symbols(sym) {1008 for_all_symbols(sym) {
1009 sym_calc_value(sym);1009 sym_calc_value(sym);
1010 if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name)1010 if (sym_is_choice(sym))
1011 continue;1011 continue;
1012 if (sym->flags & SYMBOL_WRITE) {1012 if (sym->flags & SYMBOL_WRITE) {
1013 if (sym->flags & SYMBOL_DEF_AUTO) {1013 if (sym->flags & SYMBOL_DEF_AUTO) {
scripts/kconfig/expr.h+0−1
@@ -135,7 +135,6 @@ struct symbol { · 134 unmodified lines
135#define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */135#define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */
136#define SYMBOL_CHANGED 0x0400 /* ? */136#define SYMBOL_CHANGED 0x0400 /* ? */
137#define SYMBOL_WRITTEN 0x0800 /* track info to avoid double-write to .config */137#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 */
139#define SYMBOL_CHECKED 0x2000 /* used during dependency checking */138#define SYMBOL_CHECKED 0x2000 /* used during dependency checking */
140#define SYMBOL_WARNED 0x8000 /* warning has been issued */139#define SYMBOL_WARNED 0x8000 /* warning has been issued */
141 140
scripts/kconfig/gconf.c+0−2
@@ -91,8 +91,6 @@ static const char *dbg_sym_flags(int val) · 90 unmodified lines
91 strcat(buf, "write/");91 strcat(buf, "write/");
92 if (val & SYMBOL_CHANGED)92 if (val & SYMBOL_CHANGED)
93 strcat(buf, "changed/");93 strcat(buf, "changed/");
94 if (val & SYMBOL_NO_WRITE)
95 strcat(buf, "no_write/");
96 94
97 buf[strlen(buf) - 1] = '\0';95 buf[strlen(buf) - 1] = '\0';
98 96
scripts/kconfig/parser.y+1−1
@@ -222,7 +222,7 @@ config_option: T_MODULES T_EOL · 221 unmodified lines
222choice: T_CHOICE T_EOL222choice: T_CHOICE T_EOL
223{223{
224 struct symbol *sym = sym_lookup(NULL, 0);224 struct symbol *sym = sym_lookup(NULL, 0);
225 sym->flags |= SYMBOL_NO_WRITE;225
226 menu_add_entry(sym);226 menu_add_entry(sym);
227 menu_add_expr(P_CHOICE, NULL, NULL);227 menu_add_expr(P_CHOICE, NULL, NULL);
228 printd(DEBUG_PARSE, "%s:%d:choice\n", cur_filename, cur_lineno);228 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
466 if (sym->flags & SYMBOL_CHANGED)466 if (sym->flags & SYMBOL_CHANGED)
467 sym_set_changed(choice_sym);467 sym_set_changed(choice_sym);
468 }468 }
469 }
470 469
471 if (sym->flags & SYMBOL_NO_WRITE)
472 sym->flags &= ~SYMBOL_WRITE;470 sym->flags &= ~SYMBOL_WRITE;
471 }
473 472
474 if (sym->flags & SYMBOL_NEED_SET_CHOICE_VALUES)473 if (sym->flags & SYMBOL_NEED_SET_CHOICE_VALUES)
475 set_all_choice_values(sym);474 set_all_choice_values(sym);