linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: Kconfig: Set default value for the "Kernel code model"

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH] MIPS: Kconfig: Set default value for the "Kernel code model"
From: Markos Chandras <hwoarang@gentoo.org>
Date: Wed, 12 Jun 2013 12:50:31 +0100
Cc: Markos Chandras <markos.chandras@imgtec.com>, linux-mips@linux-mips.org, Michal Marek <mmarek@suse.cz>, linux-kbuild@vger.kernel.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=GKfMKfGsXNWvXyuIhFK0/MvkY0zwAh1gTwPK76WB/0Q=; b=rqNSuBm4/elOOu3RHA7DMBkBRwT7onmZ+dzraS+nnN/ZnXG8nw0UPGLApef6fM3HAF bH9y6ze+eEOZei7TBindbpISca/QNzF/rrd75Rpswhqv7oAAW+OIGuHuG0lg48ATK5FC RBXKkI6yAl8WGKZOv1Cmw1IoA5bfRMjJTxcBrnKBykHKgqsH/E8zh6PeBH3z29sZ3alA Xx+prY3nHtHZkPAWnZJt9LiplrEXlqLSGUo+AUjAuBhB3K/i1kNTWZ5f+peiqFnMOC3q DxWBb8tHrE2BbT+jJu/DxftMQkW8iI8WwZHJtQ/twwsJJhluZjgzk74dH/ZeUte4Tx2q AZ1g==
In-reply-to: <20130612112009.GA7422@linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1370944336-13703-1-git-send-email-markos.chandras@imgtec.com> <20130611154129.GD13126@linux-mips.org> <20130612112009.GA7422@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On 12 June 2013 12:20, Ralf Baechle <ralf@linux-mips.org> wrote:
> Here's a simplified test case:
>
> < --------- bite here --------- >
> choice
>         prompt "choice 1"
>
> config FOO1
>         bool "foo 1"
>
> config FOO2
>         bool "foo 2"
> endchoice
>
> choice
>         prompt "frob"
>
> config BAR
>         bool "bar"
>         depends on FOO2
>
> endchoice
> < --------- bite here --------- >
>
> Save this to a file, then run:
>
>   scripts/kconfig/conf --randconfig /tmp/xxx && cat .config
>
> There will be two possible variants for generated .config files:
>
> < --------- Variant 1 --------- >
> CONFIG_FOO1=y
> # CONFIG_FOO2 is not set
> < --------- Variant 2 --------- >
> # CONFIG_FOO1 is not set
> # CONFIG_FOO2 is not set
> < --------- End       --------- >
>
> The intended third outcome which would be
> < --------- doesn't happen ---- >
> # CONFIG_FOO1 is not set
> CONFIG_FOO2=y
> < --------- End --------------- >
>
> never gets generated.
>
> Pretty much any tempering with this test case will change the behaviour.
> For example removing the "depends on FOO2" line will result in the
> behaviour of either CONFIG_FOO1 or CONFIG_FOO2 being set to y but never
> none or both.  Other minor changes might result in both symbols getting
> set.
>
>   Ralf
>

Thanks for the testcase Ralf. My understanding is that if the 'choice'
symbol is available (meaning, all the dependencies are satisfied),
then one of the possible choices should always be selected. So
variant2 in the previous example seems wrong behavior to me.

--
Regards,
Markos Chandras - Gentoo Linux Developer
http://dev.gentoo.org/~hwoarang

<Prev in Thread] Current Thread [Next in Thread>