Re: [PATCH] kconfig: do randomise choice entries in presence of KCONFIG_ALLCONFIG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Yann E. MORIN,

On Sun, 10 Mar 2013 17:01:53 +0100, Yann E. MORIN wrote:
> Currently, randconfig does randomise choice entries, unless KCONFIG_ALLCONFIG
> is specified.
> 
> For example, given those two files (Thomas' test-case):
> 
>     ---8<--- Config.test.in
>     config OPTIONA
>         bool "Option A"
> 
>     choice
>         prompt "This is a choice"
> 
>     config CHOICE_OPTIONA
>         bool "Choice Option A"
> 
>     config CHOICE_OPTIONB
>         bool "Choice Option B"
> 
>     endchoice
> 
>     config OPTIONB
>         bool "Option B"
>     ---8<---
> 
>     ---8<--- config.defaults
>     CONFIG_OPTIONA=y
>     ---8<---
> 
> And running:
>     ./scripts/kconfig/conf --randconfig Config.test.in
> 
> does properly randomise the two choice symbols (and the two booleans).
> 
> However, running:
>     KCONFIG_ALLCONFIG=config.defaults \
>     ./scripts/kconfig/conf --randconfig Config.test.in
> 
> does *not* reandomise the two choice entries, and only CHOICE_OPTIONA
> will ever be selected. (OPTIONA will always be set (expected), and
> OPTIONB will be be properly randomised (expected).)
> 
> This patch defers setting that a choice has a value until a symbol for
> that choice is indeed set, so that choices are properly randomised when
> KCONFIG_ALLCONFIG is set, but not if a symbol for that choice is set.
> 
> Reported-by: Thomas Petazzoni <thomas.petazzoni@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@xxxxxxx>
> Cc: Michal Marek <mmarek@xxxxxxx>
> Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>
> Cc: Arnaud Lacombe <lacombar@xxxxxxxxx>

I confirm that the patch fixes the issue for me, but I am not able to
judge the absence of side-effects. Thanks Yann for the investigation!

Tested-by: Thomas Petazzoni <thomas.petazzoni@xxxxxxxxxxxxxxxxxx>
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux