Revert "kconfig: fix __enabled_ macros definition for invisible and un-selected symbols"
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 12 Apr 2012 23:46:33 +0000 (19:46 -0400)
committerChristian Lamparter <chunkeey@googlemail.com>
Sat, 5 May 2012 13:04:55 +0000 (15:04 +0200)
This reverts commit 953742c8fe8ac45be453fee959d7be40cd89f920.

Dumping two lines into autoconf.h for all existing Kconfig options
results in a giant file (~16k lines) we have to process each time we
compile something.  We've weaned IS_ENABLED() and similar off of
requiring the __enabled_ definitions so now we can revert the change
which caused all the extra lines.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
config/confdata.c

index bcf84324d80b8532413ec63440d38352cab1ac97..41a59bbc76ce1b8b22fb0c2b15f0680ae7366500 100644 (file)
@@ -535,6 +535,17 @@ header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
                        fprintf(fp, "#define %s%s%s 1\n",
                            CONFIG_, sym->name, suffix);
                }
+               /*
+                * Generate the __enabled_CONFIG_* and
+                * __enabled_CONFIG_*_MODULE macros for use by the
+                * IS_{ENABLED,BUILTIN,MODULE} macros. The _MODULE variant is
+                * generated even for booleans so that the IS_ENABLED() macro
+                * works.
+                */
+               fprintf(fp, "#define __enabled_" CONFIG_ "%s %d\n",
+                               sym->name, (*value == 'y'));
+               fprintf(fp, "#define __enabled_" CONFIG_ "%s_MODULE %d\n",
+                               sym->name, (*value == 'm'));
                break;
        }
        case S_HEX: {
@@ -585,35 +596,6 @@ static struct conf_printer header_printer_cb =
        .print_comment = header_print_comment,
 };
 
-/*
- * Generate the __enabled_CONFIG_* and __enabled_CONFIG_*_MODULE macros for
- * use by the IS_{ENABLED,BUILTIN,MODULE} macros. The _MODULE variant is
- * generated even for booleans so that the IS_ENABLED() macro works.
- */
-static void
-header_print__enabled_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
-{
-
-       switch (sym->type) {
-       case S_BOOLEAN:
-       case S_TRISTATE: {
-               fprintf(fp, "#define __enabled_" CONFIG_ "%s %d\n",
-                   sym->name, (*value == 'y'));
-               fprintf(fp, "#define __enabled_" CONFIG_ "%s_MODULE %d\n",
-                   sym->name, (*value == 'm'));
-               break;
-       }
-       default:
-               break;
-       }
-}
-
-static struct conf_printer header__enabled_printer_cb =
-{
-       .print_symbol = header_print__enabled_symbol,
-       .print_comment = header_print_comment,
-};
-
 /*
  * Tristate printer
  *
@@ -1004,16 +986,11 @@ int conf_write_autoconf(void)
        conf_write_heading(out_c, &kconfig_printer_cmake_cb, NULL);
 
        for_all_symbols(i, sym) {
-               if (!sym->name)
-                       continue;
-
                sym_calc_value(sym);
-
-               conf_write_symbol(out_h, sym, &header__enabled_printer_cb, NULL);
-
-               if (!(sym->flags & SYMBOL_WRITE))
+               if (!(sym->flags & SYMBOL_WRITE) || !sym->name)
                        continue;
 
+               /* write symbol to auto.conf, tristate and header files */
                conf_write_symbol(out, sym, &kconfig_printer_cb, (void *)1);
 
                conf_write_symbol(tristate, sym, &tristate_printer_cb, (void *)1);