All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: linux-kbuild@vger.kernel.org
Cc: Michal Marek <mmarek@suse.cz>,
	linux-kernel@vger.kernel.org,
	"Yann E. MORIN" <yann.morin.1998@free.fr>
Subject: [PATCH 4/8] kconfig: fix randconfig tristate detection
Date: Thu, 25 Apr 2013 00:29:51 +0200	[thread overview]
Message-ID: <61fa0e17f99b60b851d4480605b7d905d3172f0c.1366841993.git.yann.morin.1998@free.fr> (raw)
In-Reply-To: <cover.1366841993.git.yann.morin.1998@free.fr>
In-Reply-To: <cover.1366841993.git.yann.morin.1998@free.fr>

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

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" <yann.morin.1998@free.fr>
---
 scripts/kconfig/confdata.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 13ddf11..306cbc1 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -1125,7 +1125,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:
-- 
1.7.10.4


  parent reply	other threads:[~2013-04-24 22:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 22:29 [pull request v2] Pull request for branch yem-kconfig-for-next Yann E. MORIN
2013-04-24 22:29 ` [PATCH 1/8] menuconfig: Fix memory leak introduced by jump keys feature Yann E. MORIN
2013-04-24 22:29 ` [PATCH 2/8] menuconfig: Add "breadcrumbs" navigation aid Yann E. MORIN
2013-04-24 22:29 ` [PATCH 3/8] kconfig/lxdialog: rationalise the include paths where to find {.n}curses{,w}.h Yann E. MORIN
2013-04-24 22:29 ` Yann E. MORIN [this message]
2013-04-24 22:29 ` [PATCH 5/8] kconfig: do not override symbols already set Yann E. MORIN
2013-04-24 22:29 ` [PATCH 6/8] kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG Yann E. MORIN
2013-04-26 12:05   ` Arnd Bergmann
2013-04-26 12:11     ` Yann E. MORIN
2013-04-26 22:09     ` Yann E. MORIN
2013-04-27 21:01       ` Arnd Bergmann
2013-04-27 22:31         ` Yann E. MORIN
2013-04-28  1:05           ` Arnd Bergmann
2013-04-24 22:29 ` [PATCH 7/8] kconfig: allow specifying the seed for randconfig Yann E. MORIN
2013-04-24 22:29 ` [PATCH 8/8] kconfig: implement KCONFIG_PROBABILITY " Yann E. MORIN
2013-04-25  8:57   ` Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61fa0e17f99b60b851d4480605b7d905d3172f0c.1366841993.git.yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.