diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-27 12:59:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-27 12:59:59 -0400 |
commit | 6948385cbd83201fb933125c1a578b29b456605d (patch) | |
tree | fd08f30c84d02cfb1ad696d04605565974fae7be /scripts/kconfig/confdata.c | |
parent | 7a76d89232f20411f32e7a79ccc1e2f95e9f826b (diff) | |
parent | 56b2f0706d82535fd8d85503f2dcc0be40c8e55d (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: (25 commits)
setlocalversion: do not describe if there is nothing to describe
kconfig: fix typos: "Suport" -> "Support"
kconfig: make defconfig is no longer chatty
kconfig: make oldconfig is now less chatty
kconfig: speed up all*config + randconfig
kconfig: set all new symbols automatically
kconfig: add diffconfig utility
kbuild: remove Module.markers during mrproper
kbuild: sparse needs CF not CHECKFLAGS
kernel-doc: handle/strip __init
vmlinux.lds: move __attribute__((__cold__)) functions back into final .text section
init: fix URL of "The GNU Accounting Utilities"
kbuild: add arch/$ARCH/include to search path
kbuild: asm symlink support for arch/$ARCH/include
kbuild: support arch/$ARCH/include for tags, cscope
kbuild: prepare headers_* for arch/$ARCH/include
kbuild: install all headers when arch is changed
kbuild: make clean removes *.o.* as well
kbuild: optimize headers_* targets
kbuild: only one call for include/ in make headers_*
...
Diffstat (limited to 'scripts/kconfig/confdata.c')
-rw-r--r-- | scripts/kconfig/confdata.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index ee5fe943d58d..07597611cc50 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -812,3 +812,73 @@ void conf_set_changed_callback(void (*fn)(void)) | |||
812 | { | 812 | { |
813 | conf_changed_callback = fn; | 813 | conf_changed_callback = fn; |
814 | } | 814 | } |
815 | |||
816 | |||
817 | void conf_set_all_new_symbols(enum conf_def_mode mode) | ||
818 | { | ||
819 | struct symbol *sym, *csym; | ||
820 | struct property *prop; | ||
821 | struct expr *e; | ||
822 | int i, cnt, def; | ||
823 | |||
824 | for_all_symbols(i, sym) { | ||
825 | if (sym_has_value(sym)) | ||
826 | continue; | ||
827 | switch (sym_get_type(sym)) { | ||
828 | case S_BOOLEAN: | ||
829 | case S_TRISTATE: | ||
830 | switch (mode) { | ||
831 | case def_yes: | ||
832 | sym->def[S_DEF_USER].tri = yes; | ||
833 | break; | ||
834 | case def_mod: | ||
835 | sym->def[S_DEF_USER].tri = mod; | ||
836 | break; | ||
837 | case def_no: | ||
838 | sym->def[S_DEF_USER].tri = no; | ||
839 | break; | ||
840 | case def_random: | ||
841 | sym->def[S_DEF_USER].tri = (tristate)(rand() % 3); | ||
842 | break; | ||
843 | default: | ||
844 | continue; | ||
845 | } | ||
846 | if (!sym_is_choice(sym) || mode != def_random) | ||
847 | sym->flags |= SYMBOL_DEF_USER; | ||
848 | break; | ||
849 | default: | ||
850 | break; | ||
851 | } | ||
852 | |||
853 | } | ||
854 | |||
855 | if (modules_sym) | ||
856 | sym_calc_value(modules_sym); | ||
857 | |||
858 | if (mode != def_random) | ||
859 | return; | ||
860 | |||
861 | for_all_symbols(i, csym) { | ||
862 | if (sym_has_value(csym) || !sym_is_choice(csym)) | ||
863 | continue; | ||
864 | |||
865 | sym_calc_value(csym); | ||
866 | prop = sym_get_choice_prop(csym); | ||
867 | def = -1; | ||
868 | while (1) { | ||
869 | cnt = 0; | ||
870 | expr_list_for_each_sym(prop->expr, e, sym) { | ||
871 | if (sym->visible == no) | ||
872 | continue; | ||
873 | if (def == cnt++) { | ||
874 | csym->def[S_DEF_USER].val = sym; | ||
875 | break; | ||
876 | } | ||
877 | } | ||
878 | if (def >= 0 || cnt < 2) | ||
879 | break; | ||
880 | def = (rand() % cnt) + 1; | ||
881 | } | ||
882 | csym->flags |= SYMBOL_DEF_USER; | ||
883 | } | ||
884 | } | ||