aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/confdata.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/confdata.c')
-rw-r--r--scripts/kconfig/confdata.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index be6952c7fb29..df629ecb4fdf 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -487,27 +487,43 @@ static struct conf_printer kconfig_printer_cb =
487static void 487static void
488header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg) 488header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
489{ 489{
490 const char *suffix = "";
491 490
492 switch (sym->type) { 491 switch (sym->type) {
493 case S_BOOLEAN: 492 case S_BOOLEAN:
494 case S_TRISTATE: 493 case S_TRISTATE: {
494 const char *suffix = "";
495
495 switch (*value) { 496 switch (*value) {
496 case 'n': 497 case 'n':
497 return; 498 return;
498 case 'm': 499 case 'm':
499 suffix = "_MODULE"; 500 suffix = "_MODULE";
500 /* FALLTHROUGH */ 501 /* fall through */
501 default: 502 default:
502 value = "1"; 503 value = "1";
503 } 504 }
505 fprintf(fp, "#define %s%s%s %s\n",
506 CONFIG_, sym->name, suffix, value);
507 break;
508 }
509 case S_HEX: {
510 const char *prefix = "";
511
512 if (value[0] != '0' || (value[1] != 'x' && value[1] != 'X'))
513 prefix = "0x";
514 fprintf(fp, "#define %s%s %s%s\n",
515 CONFIG_, sym->name, prefix, value);
516 break;
517 }
518 case S_STRING:
519 case S_INT:
520 fprintf(fp, "#define %s%s %s\n",
521 CONFIG_, sym->name, value);
504 break; 522 break;
505 default: 523 default:
506 break; 524 break;
507 } 525 }
508 526
509 fprintf(fp, "#define %s%s%s %s\n",
510 CONFIG_, sym->name, suffix, value);
511} 527}
512 528
513static void 529static void