Skip to content

Commit a959613

Browse files
Paul Gortmakertorvalds
authored andcommitted
Revert "kconfig: fix __enabled_ macros definition for invisible and un-selected symbols"
This reverts commit 953742c. 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 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 69349c2 commit a959613

File tree

1 file changed

+13
-36
lines changed

1 file changed

+13
-36
lines changed

scripts/kconfig/confdata.c

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,17 @@ header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
489489
fprintf(fp, "#define %s%s%s 1\n",
490490
CONFIG_, sym->name, suffix);
491491
}
492+
/*
493+
* Generate the __enabled_CONFIG_* and
494+
* __enabled_CONFIG_*_MODULE macros for use by the
495+
* IS_{ENABLED,BUILTIN,MODULE} macros. The _MODULE variant is
496+
* generated even for booleans so that the IS_ENABLED() macro
497+
* works.
498+
*/
499+
fprintf(fp, "#define __enabled_" CONFIG_ "%s %d\n",
500+
sym->name, (*value == 'y'));
501+
fprintf(fp, "#define __enabled_" CONFIG_ "%s_MODULE %d\n",
502+
sym->name, (*value == 'm'));
492503
break;
493504
}
494505
case S_HEX: {
@@ -539,35 +550,6 @@ static struct conf_printer header_printer_cb =
539550
.print_comment = header_print_comment,
540551
};
541552

542-
/*
543-
* Generate the __enabled_CONFIG_* and __enabled_CONFIG_*_MODULE macros for
544-
* use by the IS_{ENABLED,BUILTIN,MODULE} macros. The _MODULE variant is
545-
* generated even for booleans so that the IS_ENABLED() macro works.
546-
*/
547-
static void
548-
header_print__enabled_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
549-
{
550-
551-
switch (sym->type) {
552-
case S_BOOLEAN:
553-
case S_TRISTATE: {
554-
fprintf(fp, "#define __enabled_" CONFIG_ "%s %d\n",
555-
sym->name, (*value == 'y'));
556-
fprintf(fp, "#define __enabled_" CONFIG_ "%s_MODULE %d\n",
557-
sym->name, (*value == 'm'));
558-
break;
559-
}
560-
default:
561-
break;
562-
}
563-
}
564-
565-
static struct conf_printer header__enabled_printer_cb =
566-
{
567-
.print_symbol = header_print__enabled_symbol,
568-
.print_comment = header_print_comment,
569-
};
570-
571553
/*
572554
* Tristate printer
573555
*
@@ -949,16 +931,11 @@ int conf_write_autoconf(void)
949931
conf_write_heading(out_h, &header_printer_cb, NULL);
950932

951933
for_all_symbols(i, sym) {
952-
if (!sym->name)
953-
continue;
954-
955934
sym_calc_value(sym);
956-
957-
conf_write_symbol(out_h, sym, &header__enabled_printer_cb, NULL);
958-
959-
if (!(sym->flags & SYMBOL_WRITE))
935+
if (!(sym->flags & SYMBOL_WRITE) || !sym->name)
960936
continue;
961937

938+
/* write symbol to auto.conf, tristate and header files */
962939
conf_write_symbol(out, sym, &kconfig_printer_cb, (void *)1);
963940

964941
conf_write_symbol(tristate, sym, &tristate_printer_cb, (void *)1);

0 commit comments

Comments
 (0)