Skip to content

Commit

Permalink
kconfig: remove SYMBOL_NO_WRITE flag
Browse files Browse the repository at this point in the history
This flag is set to symbols that are not intended to be written
to the .config file.

Since commit b75b0a8 ("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.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
Masahiro Yamada committed May 2, 2024
1 parent aba0915 commit a7c79cf
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ int conf_read(const char *name)

for_all_symbols(sym) {
sym_calc_value(sym);
if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE))
if (sym_is_choice(sym))
continue;
if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) {
/* check that calculated value agrees with saved value */
Expand Down Expand Up @@ -1007,7 +1007,7 @@ static int conf_touch_deps(void)

for_all_symbols(sym) {
sym_calc_value(sym);
if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name)
if (sym_is_choice(sym))
continue;
if (sym->flags & SYMBOL_WRITE) {
if (sym->flags & SYMBOL_DEF_AUTO) {
Expand Down
1 change: 0 additions & 1 deletion scripts/kconfig/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ struct symbol {
#define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */
#define SYMBOL_CHANGED 0x0400 /* ? */
#define SYMBOL_WRITTEN 0x0800 /* track info to avoid double-write to .config */
#define SYMBOL_NO_WRITE 0x1000 /* Symbol for internal use only; it will not be written */
#define SYMBOL_CHECKED 0x2000 /* used during dependency checking */
#define SYMBOL_WARNED 0x8000 /* warning has been issued */

Expand Down
2 changes: 0 additions & 2 deletions scripts/kconfig/gconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ static const char *dbg_sym_flags(int val)
strcat(buf, "write/");
if (val & SYMBOL_CHANGED)
strcat(buf, "changed/");
if (val & SYMBOL_NO_WRITE)
strcat(buf, "no_write/");

buf[strlen(buf) - 1] = '\0';

Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ config_option: T_MODULES T_EOL
choice: T_CHOICE T_EOL
{
struct symbol *sym = sym_lookup(NULL, 0);
sym->flags |= SYMBOL_NO_WRITE;

menu_add_entry(sym);
menu_add_expr(P_CHOICE, NULL, NULL);
printd(DEBUG_PARSE, "%s:%d:choice\n", cur_filename, cur_lineno);
Expand Down
3 changes: 1 addition & 2 deletions scripts/kconfig/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,9 @@ void sym_calc_value(struct symbol *sym)
if (sym->flags & SYMBOL_CHANGED)
sym_set_changed(choice_sym);
}
}

if (sym->flags & SYMBOL_NO_WRITE)
sym->flags &= ~SYMBOL_WRITE;
}

if (sym->flags & SYMBOL_NEED_SET_CHOICE_VALUES)
set_all_choice_values(sym);
Expand Down

0 comments on commit a7c79cf

Please sign in to comment.