From: Peter Korsgaard Date: Thu, 22 Jul 2010 12:24:57 +0000 (+0200) Subject: kconfig: make randconfig fair for booleans X-Git-Tag: v2.6.36-rc1~547^2~11 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=1244b41d00eb60cb3d05220383bc9d15b9045fb4 kconfig: make randconfig fair for booleans Give boolean symbols a 50% chance of getting enabled, rather than 67%. Signed-off-by: Peter Korsgaard Acked-by: Sam Ravnborg Signed-off-by: Michal Marek --- 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) sym->def[S_DEF_USER].tri = no; break; case def_random: - sym->def[S_DEF_USER].tri = (tristate)(rand() % 3); + cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2; + sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt); break; default: continue;