public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kconfig: make randconfig fair for booleans
@ 2010-07-22 12:24 Peter Korsgaard
  2010-07-23 21:11 ` Sam Ravnborg
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2010-07-22 12:24 UTC (permalink / raw)
  To: linux-kbuild, zippel, mmarek, sam; +Cc: Peter Korsgaard

Give boolean symbols a 50% chance of getting enabled, rather than 67%.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
 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 c4dec80..210a49e 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;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-07-26 15:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-22 12:24 [PATCH] kconfig: make randconfig fair for booleans Peter Korsgaard
2010-07-23 21:11 ` Sam Ravnborg
2010-07-26  9:59   ` Michal Marek
2010-07-26 13:52     ` Michal Marek
2010-07-26 15:20       ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox