diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2010-07-22 08:24:57 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-07-26 09:40:52 -0400 |
commit | 1244b41d00eb60cb3d05220383bc9d15b9045fb4 (patch) | |
tree | e2bbc9314704a86dd34d8043a862696d9948f3f5 /scripts/kconfig | |
parent | 0a28c47b8db8ff74d1bfbc5c5ad0100cea472351 (diff) |
kconfig: make randconfig fair for booleans
Give boolean symbols a 50% chance of getting enabled, rather than 67%.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r-- | scripts/kconfig/confdata.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index c4dec80cfd8e..210a49e27d47 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -862,7 +862,8 @@ void conf_set_all_new_symbols(enum conf_def_mode mode) | |||
862 | sym->def[S_DEF_USER].tri = no; | 862 | sym->def[S_DEF_USER].tri = no; |
863 | break; | 863 | break; |
864 | case def_random: | 864 | case def_random: |
865 | sym->def[S_DEF_USER].tri = (tristate)(rand() % 3); | 865 | cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2; |
866 | sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt); | ||
866 | break; | 867 | break; |
867 | default: | 868 | default: |
868 | continue; | 869 | continue; |