Skip to content

Commit 61fa0e1

Browse files
kconfig: fix randconfig tristate detection
Because the modules' symbole (CONFIG_MODULES) may not yet be set when we check a symbol's tristate capabilty, we'll always find that tristate symbols are booleans, even if we randomly decided that to enable modules: sym_get_type(sym) always return boolean for tristates when modules_sym has not been previously set to 'y' *and* its value calculated *and* its visibility calculated, both of which only occur after we randomly assign values to symbols. Fix that by looking at the raw type of symbols. Tristate set to 'm' will be promoted to 'y' when their values will be later calculated. Signed-off-by: "Yann E. MORIN" <[email protected]>
1 parent cdf0c2c commit 61fa0e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/kconfig/confdata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ void conf_set_all_new_symbols(enum conf_def_mode mode)
11251125
sym->def[S_DEF_USER].tri = no;
11261126
break;
11271127
case def_random:
1128-
cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2;
1128+
cnt = sym->type == S_TRISTATE ? 3 : 2;
11291129
sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt);
11301130
break;
11311131
default:

0 commit comments

Comments
 (0)