Replacing S_TRISTATE by S_BOOLEAN is a no-op for conf_write_symbol().
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -440,12 +440,11 @@ static void conf_write_string(bool headerfile, const char *name, · 439 unmodified lines | ||
| 440 | 440 | fputs("\"\n", out); |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | −static void conf_write_symbol(struct symbol *sym, enum symbol_type type, | |
| 444 | − FILE *out, bool write_no) | |
| 443 | +static void conf_write_symbol(struct symbol *sym, FILE *out, bool write_no) | |
| 445 | 444 | { |
| 446 | 445 | const char *str; |
| 447 | 446 | |
| 448 | − switch (type) { | |
| 447 | + switch (sym->type) { | |
| 449 | 448 | case S_BOOLEAN: |
| 450 | 449 | case S_TRISTATE: |
| 451 | 450 | switch (sym_get_tristate_value(sym)) { |
| @@ -532,7 +531,7 @@ int conf_write_defconfig(const char *filename) · 80 unmodified lines | ||
| 532 | 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 | } |
| 537 | 536 | next_menu: |
| 538 | 537 | if (menu->list != NULL) { |
| @@ -561,7 +560,6 @@ int conf_write(const char *name) · 22 unmodified lines | ||
| 561 | 560 | const char *basename; |
| 562 | 561 | const char *str; |
| 563 | 562 | char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1]; |
| 564 | − enum symbol_type type; | |
| 565 | 563 | time_t now; |
| 566 | 564 | int use_timestamp = 1; |
| 567 | 565 | char *env; |
| @@ -633,14 +631,8 @@ int conf_write(const char *name) · 65 unmodified lines | ||
| 633 | 631 | if (!(sym->flags & SYMBOL_WRITE)) |
| 634 | 632 | goto next; |
| 635 | 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 | 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 | |
| 646 | 638 | next: |
| @@ -842,7 +834,7 @@ int conf_write_autoconf(void) · 195 unmodified lines | ||
| 842 | 834 | continue; |
| 843 | 835 | |
| 844 | 836 | /* write symbol to config file */ |
| 845 | − conf_write_symbol(sym, sym->type, out, false); | |
| 837 | + conf_write_symbol(sym, out, false); | |
| 846 | 838 | |
| 847 | 839 | /* update autoconf and tristate files */ |
| 848 | 840 | switch (sym->type) { |