kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE
authorDirk Gouders <dirk@gouders.net>
Tue, 3 Jul 2018 12:43:31 +0000 (14:43 +0200)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 17 Jul 2018 16:18:09 +0000 (01:18 +0900)
Over time, the use of the flag SYMBOL_AUTO changed from initially
marking three automatically generated symbols ARCH, KERNELRELEASE and
UNAME_RELEASE to today's effect of protecting symbols from being
written out.

Currently, only symbols of type CHOICE and those with option
defconf_list set have that flag set.

Reflect that change in semantics in the flag's name.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/kconfig/confdata.c
scripts/kconfig/expr.h
scripts/kconfig/gconf.c
scripts/kconfig/menu.c
scripts/kconfig/symbol.c
scripts/kconfig/zconf.y

index 39e2097..d1216e4 100644 (file)
@@ -397,7 +397,7 @@ int conf_read(const char *name)
 
        for_all_symbols(i, sym) {
                sym_calc_value(sym);
-               if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO))
+               if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE))
                        continue;
                if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) {
                        /* check that calculated value agrees with saved value */
@@ -832,7 +832,7 @@ static int conf_split_config(void)
        res = 0;
        for_all_symbols(i, sym) {
                sym_calc_value(sym);
-               if ((sym->flags & SYMBOL_AUTO) || !sym->name)
+               if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name)
                        continue;
                if (sym->flags & SYMBOL_WRITE) {
                        if (sym->flags & SYMBOL_DEF_AUTO) {
index f63b41b..84a5199 100644 (file)
@@ -141,7 +141,7 @@ struct symbol {
 #define SYMBOL_OPTIONAL   0x0100  /* choice is optional - values can be 'n' */
 #define SYMBOL_WRITE      0x0200  /* write symbol to file (KCONFIG_CONFIG) */
 #define SYMBOL_CHANGED    0x0400  /* ? */
-#define SYMBOL_AUTO       0x1000  /* value from environment variable */
+#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 */
 
index 610c4ab..a9e48cc 100644 (file)
@@ -101,8 +101,8 @@ const char *dbg_sym_flags(int val)
                strcat(buf, "write/");
        if (val & SYMBOL_CHANGED)
                strcat(buf, "changed/");
-       if (val & SYMBOL_AUTO)
-               strcat(buf, "auto/");
+       if (val & SYMBOL_NO_WRITE)
+               strcat(buf, "no_write/");
 
        buf[strlen(buf) - 1] = '\0';
 
index 379a119..4cf15d4 100644 (file)
@@ -212,7 +212,7 @@ void menu_add_option(int token, char *arg)
                        sym_defconfig_list = current_entry->sym;
                else if (sym_defconfig_list != current_entry->sym)
                        zconf_error("trying to redefine defconfig symbol");
-               sym_defconfig_list->flags |= SYMBOL_AUTO;
+               sym_defconfig_list->flags |= SYMBOL_NO_WRITE;
                break;
        case T_OPT_ALLNOCONFIG_Y:
                current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y;
index 7c9a88e..869a5e8 100644 (file)
@@ -463,7 +463,7 @@ void sym_calc_value(struct symbol *sym)
                }
        }
 
-       if (sym->flags & SYMBOL_AUTO)
+       if (sym->flags & SYMBOL_NO_WRITE)
                sym->flags &= ~SYMBOL_WRITE;
 
        if (sym->flags & SYMBOL_NEED_SET_CHOICE_VALUES)
index 4b68272..96081aa 100644 (file)
@@ -265,7 +265,7 @@ symbol_option_arg:
 choice: T_CHOICE word_opt T_EOL
 {
        struct symbol *sym = sym_lookup($2, SYMBOL_CHOICE);
-       sym->flags |= SYMBOL_AUTO;
+       sym->flags |= SYMBOL_NO_WRITE;
        menu_add_entry(sym);
        menu_add_expr(P_CHOICE, NULL, NULL);
        free($2);