Skip to content

Commit

Permalink
kconfig: make randconfig fair for booleans
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Korsgaard authored and Michal Marek committed Jul 26, 2010
1 parent 0a28c47 commit 1244b41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1244b41

Please sign in to comment.