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.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 9df80114b47b..61c35bf2d9cb 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -440,12 +440,11 @@ static void conf_write_string(bool headerfile, const char *name,
440 fputs("\"\n", out); 440 fputs("\"\n", out);
441} 441}
442 442
443static void conf_write_symbol(struct symbol *sym, enum symbol_type type, 443static void conf_write_symbol(struct symbol *sym, FILE *out, bool write_no)
444 FILE *out, bool write_no)
445{ 444{
446 const char *str; 445 const char *str;
447 446
448 switch (type) { 447 switch (sym->type) {
449 case S_BOOLEAN: 448 case S_BOOLEAN:
450 case S_TRISTATE: 449 case S_TRISTATE:
451 switch (sym_get_tristate_value(sym)) { 450 switch (sym_get_tristate_value(sym)) {
@@ -532,7 +531,7 @@ int conf_write_defconfig(const char *filename)
532 goto next_menu; 531 goto next_menu;
533 } 532 }
534 } 533 }
535 conf_write_symbol(sym, sym->type, out, true); 534 conf_write_symbol(sym, out, true);
536 } 535 }
537next_menu: 536next_menu:
538 if (menu->list != NULL) { 537 if (menu->list != NULL) {
@@ -561,7 +560,6 @@ int conf_write(const char *name)
561 const char *basename; 560 const char *basename;
562 const char *str; 561 const char *str;
563 char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1]; 562 char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1];
564 enum symbol_type type;
565 time_t now; 563 time_t now;
566 int use_timestamp = 1; 564 int use_timestamp = 1;
567 char *env; 565 char *env;
@@ -633,14 +631,8 @@ int conf_write(const char *name)
633 if (!(sym->flags & SYMBOL_WRITE)) 631 if (!(sym->flags & SYMBOL_WRITE))
634 goto next; 632 goto next;
635 sym->flags &= ~SYMBOL_WRITE; 633 sym->flags &= ~SYMBOL_WRITE;
636 type = sym->type;
637 if (type == S_TRISTATE) {
638 sym_calc_value(modules_sym);
639 if (modules_sym->curr.tri == no)
640 type = S_BOOLEAN;
641 }
642 /* Write config symbol to file */ 634 /* Write config symbol to file */
643 conf_write_symbol(sym, type, out, true); 635 conf_write_symbol(sym, out, true);
644 } 636 }
645 637
646next: 638next:
@@ -833,8 +825,7 @@ int conf_write_autoconf(void)
833 " * Automatically generated C config: don't edit\n" 825 " * Automatically generated C config: don't edit\n"
834 " * %s\n" 826 " * %s\n"
835 " * %s" 827 " * %s"
836 " */\n" 828 " */\n",
837 "#define AUTOCONF_INCLUDED\n",
838 rootmenu.prompt->text, ctime(&now)); 829 rootmenu.prompt->text, ctime(&now));
839 830
840 for_all_symbols(i, sym) { 831 for_all_symbols(i, sym) {
@@ -843,7 +834,7 @@ int conf_write_autoconf(void)
843 continue; 834 continue;
844 835
845 /* write symbol to config file */ 836 /* write symbol to config file */
846 conf_write_symbol(sym, sym->type, out, false); 837 conf_write_symbol(sym, out, false);
847 838
848 /* update autoconf and tristate files */ 839 /* update autoconf and tristate files */
849 switch (sym->type) { 840 switch (sym->type) {
@@ -946,7 +937,7 @@ static void randomize_choice_values(struct symbol *csym)
946 int cnt, def; 937 int cnt, def;
947 938
948 /* 939 /*
949 * If choice is mod then we may have more items slected 940 * If choice is mod then we may have more items selected
950 * and if no then no-one. 941 * and if no then no-one.
951 * In both cases stop. 942 * In both cases stop.
952 */ 943 */
@@ -1042,10 +1033,10 @@ void conf_set_all_new_symbols(enum conf_def_mode mode)
1042 1033
1043 /* 1034 /*
1044 * We have different type of choice blocks. 1035 * We have different type of choice blocks.
1045 * If curr.tri equal to mod then we can select several 1036 * If curr.tri equals to mod then we can select several
1046 * choice symbols in one block. 1037 * choice symbols in one block.
1047 * In this case we do nothing. 1038 * In this case we do nothing.
1048 * If curr.tri equal yes then only one symbol can be 1039 * If curr.tri equals yes then only one symbol can be
1049 * selected in a choice block and we set it to yes, 1040 * selected in a choice block and we set it to yes,
1050 * and the rest to no. 1041 * and the rest to no.
1051 */ 1042 */