Skip to contentSkip to conversation

kconfig: make randconfig fair for booleans

PATCH In review Peter Korsgaard 4 participants 5 messages Jul 22, 2010 – Jul 26, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kconfig: make randconfig fair for booleans

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

---
 scripts/kconfig/confdata.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
scripts/kconfig/confdata.c +2 -1
index c4dec80..210a49e 100644
@@ -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;
Signature · 1 line
1.7.1
#2 lore raw
Quoted 10 lines · Sam Ravnborg
Quoted 3 lines · Peter Korsgaard

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

Good catch!

Michal - I assume you apply this for next merge window.

Yes, will do. I've been busy (again :)) for the last two weeks, so only reviewed the few patches for .35.

Michal

#3 lore raw
Quoted 6 lines · Michal Marek
Quoted 5 lines · Sam Ravnborg
Quoted 3 lines · Peter Korsgaard

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

Quoted 8 lines
Quoted 5 lines

Good catch!

Michal - I assume you apply this for next merge window.

Yes, will do. I've been busy (again :)) for the last two weeks, so only reviewed the few patches for .35.

Applied now.

CCing Randy. FYI, you'll see a little less builds with CONFIG_MODULES=y starting with tomorrow's linux-next. It should not matter unless you're maintaining some statistics.

Michal

#4 lore raw
Quoted 13 lines · Michal Marek
Quoted 12 lines · Michal Marek
Quoted 10 lines · Sam Ravnborg
Quoted 3 lines · Peter Korsgaard

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

Good catch!

Michal - I assume you apply this for next merge window.

Quoted 8 lines
Quoted 2 lines

Yes, will do. I've been busy (again :)) for the last two weeks, so only reviewed the few patches for .35.

Applied now.

CCing Randy. FYI, you'll see a little less builds with CONFIG_MODULES=y starting with tomorrow's linux-next. It should not matter unless you're maintaining some statistics.

Thanks. Not a problem. No stats.

Signature · 2 lines
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***