From: Yann E. MORIN Date: Wed, 24 Apr 2013 16:14:27 +0000 (+0200) Subject: kconfig: fix randconfig tristate detection X-Git-Tag: 1.9.9~36 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=1a512d9c9add1b925ec1dfd5dc40bc0db0ea5ad7;hp=804ea83f028087bf20b21ede2a41f9ab5efe0df1;p=carl9170fw.git 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" Signed-off-by: Christian Lamparter --- diff --git a/config/confdata.c b/config/confdata.c index 7a2bc8f..423ac06 100644 --- a/config/confdata.c +++ b/config/confdata.c @@ -1188,7 +1188,7 @@ void conf_set_all_new_symbols(enum conf_def_mode mode) sym->def[S_DEF_USER].tri = no; break; case def_random: - cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2; + cnt = sym->type == S_TRISTATE ? 3 : 2; sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt); break; default: