diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-10 11:28:17 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-10 11:28:17 -0500 |
| commit | f28b1c8aaa97a68028bb894bffb1690185c62b01 (patch) | |
| tree | 4dfd0e1dff2324ed70e2365d2314ff3ec7f7c751 /scripts | |
| parent | 0c05384a5a1af2352b8c244cf32f480ba6cbf024 (diff) | |
| parent | 39177ec36236fb71257e51d0d198437b84170911 (diff) | |
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
nconf: handle comment entries within choice/endchoice
kconfig: fix warning
kconfig: Make expr_copy() take a const argument
kconfig: simplify select-with-unmet-direct-dependency warning
kconfig: add more S_INT and S_HEX consistency checks
kconfig: fix `zconfdebug' extern declaration
kconfig/conf: merge duplicate switch's case
kconfig: fix typos
kbuild/gconf: add dummy inline for bind_textdomain_codeset()
kbuild/nconf: fix spaces damage
kconfig: nuke second argument of conf_write_symbol()
kconfig: do not define AUTOCONF_INCLUDED
kconfig: the day kconfig warns about "select"-abuse has come
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/kconfig/conf.c | 2 | ||||
| -rw-r--r-- | scripts/kconfig/confdata.c | 27 | ||||
| -rw-r--r-- | scripts/kconfig/expr.c | 44 | ||||
| -rw-r--r-- | scripts/kconfig/expr.h | 3 | ||||
| -rw-r--r-- | scripts/kconfig/lkc.h | 7 | ||||
| -rw-r--r-- | scripts/kconfig/menu.c | 15 | ||||
| -rw-r--r-- | scripts/kconfig/nconf.c | 10 | ||||
| -rw-r--r-- | scripts/kconfig/symbol.c | 8 |
8 files changed, 84 insertions, 32 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 5459a38be866..659326c3e895 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
| @@ -529,8 +529,6 @@ int main(int ac, char **av) | |||
| 529 | } | 529 | } |
| 530 | break; | 530 | break; |
| 531 | case savedefconfig: | 531 | case savedefconfig: |
| 532 | conf_read(NULL); | ||
| 533 | break; | ||
| 534 | case silentoldconfig: | 532 | case silentoldconfig: |
| 535 | case oldaskconfig: | 533 | case oldaskconfig: |
| 536 | case oldconfig: | 534 | case oldconfig: |
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 | ||
| 443 | static void conf_write_symbol(struct symbol *sym, enum symbol_type type, | 443 | static 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 | } |
| 537 | next_menu: | 536 | next_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 | ||
| 646 | next: | 638 | next: |
| @@ -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 | */ |
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index 330e7c0048a8..001003452f68 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c | |||
| @@ -64,7 +64,7 @@ struct expr *expr_alloc_or(struct expr *e1, struct expr *e2) | |||
| 64 | return e2 ? expr_alloc_two(E_OR, e1, e2) : e1; | 64 | return e2 ? expr_alloc_two(E_OR, e1, e2) : e1; |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | struct expr *expr_copy(struct expr *org) | 67 | struct expr *expr_copy(const struct expr *org) |
| 68 | { | 68 | { |
| 69 | struct expr *e; | 69 | struct expr *e; |
| 70 | 70 | ||
| @@ -1013,6 +1013,48 @@ int expr_compare_type(enum expr_type t1, enum expr_type t2) | |||
| 1013 | #endif | 1013 | #endif |
| 1014 | } | 1014 | } |
| 1015 | 1015 | ||
| 1016 | static inline struct expr * | ||
| 1017 | expr_get_leftmost_symbol(const struct expr *e) | ||
| 1018 | { | ||
| 1019 | |||
| 1020 | if (e == NULL) | ||
| 1021 | return NULL; | ||
| 1022 | |||
| 1023 | while (e->type != E_SYMBOL) | ||
| 1024 | e = e->left.expr; | ||
| 1025 | |||
| 1026 | return expr_copy(e); | ||
| 1027 | } | ||
| 1028 | |||
| 1029 | /* | ||
| 1030 | * Given expression `e1' and `e2', returns the leaf of the longest | ||
| 1031 | * sub-expression of `e1' not containing 'e2. | ||
| 1032 | */ | ||
| 1033 | struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2) | ||
| 1034 | { | ||
| 1035 | struct expr *ret; | ||
| 1036 | |||
| 1037 | switch (e1->type) { | ||
| 1038 | case E_OR: | ||
| 1039 | return expr_alloc_and( | ||
| 1040 | expr_simplify_unmet_dep(e1->left.expr, e2), | ||
| 1041 | expr_simplify_unmet_dep(e1->right.expr, e2)); | ||
| 1042 | case E_AND: { | ||
| 1043 | struct expr *e; | ||
| 1044 | e = expr_alloc_and(expr_copy(e1), expr_copy(e2)); | ||
| 1045 | e = expr_eliminate_dups(e); | ||
| 1046 | ret = (!expr_eq(e, e1)) ? e1 : NULL; | ||
| 1047 | expr_free(e); | ||
| 1048 | break; | ||
| 1049 | } | ||
| 1050 | default: | ||
| 1051 | ret = e1; | ||
| 1052 | break; | ||
| 1053 | } | ||
| 1054 | |||
