public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.35-rc6] kconfig: fix MODULES-related bug in case of no .config
@ 2010-07-27 19:27 Ulf Magnusson
  2010-07-27 19:57 ` Ulf Magnusson
  0 siblings, 1 reply; 4+ messages in thread
From: Ulf Magnusson @ 2010-07-27 19:27 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel

Hi,

There seems to be a kconfig bug due to MODULES not always being evaluated if no
.config is found. Take the following Kconfig as an example:

config MODULES
	def_bool y

config FOO
	def_tristate m

With no .config, the following configuration is generated:

CONFIG_MODULES=y
CONFIG_FOO=y

With an empty .config, the following:

CONFIG_MODULES=y
CONFIG_FOO=m

Tristate choice statements can also exhibit the problem, due to having an
implicit rev_dep (select) containing "m".

The problem is that MODULES is never evaluted in conf_read_simple() unless
there's a .config. The following patch fixes this.

Signed-off-by: Ulf Magnusson <ulfalizer.lkml@gmail.com>

diff -uNr linux.vanilla/scripts/kconfig/confdata.c linux.new/scripts/kconfig/confdata.c
--- linux.vanilla/scripts/kconfig/confdata.c	2010-07-27 16:47:43.443006287 +0200
+++ linux.new/scripts/kconfig/confdata.c	2010-07-27 16:50:19.795005537 +0200
@@ -170,8 +170,10 @@
 		if (in)
 			goto load;
 		sym_add_change_count(1);
-		if (!sym_defconfig_list)
+		if (!sym_defconfig_list) {
+			sym_calc_value(modules_sym);
 			return 1;
+		}
 
 		for_all_defaults(sym_defconfig_list, prop) {
 			if (expr_calc_value(prop->visible.expr) == no ||

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.35-rc6] kconfig: fix MODULES-related bug in case of no .config
  2010-07-27 19:27 [PATCH 2.6.35-rc6] kconfig: fix MODULES-related bug in case of no .config Ulf Magnusson
@ 2010-07-27 19:57 ` Ulf Magnusson
  2010-07-28  6:23   ` Américo Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Ulf Magnusson @ 2010-07-27 19:57 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel

On Tue, Jul 27, 2010 at 09:27:27PM +0200, Ulf Magnusson wrote:
> Hi,
> 
> There seems to be a kconfig bug due to MODULES not always being evaluated if no
> .config is found. Take the following Kconfig as an example:
> 
> config MODULES
> 	def_bool y
> 
> config FOO
> 	def_tristate m
> 
> With no .config, the following configuration is generated:
> 
> CONFIG_MODULES=y
> CONFIG_FOO=y
> 
> With an empty .config, the following:
> 
> CONFIG_MODULES=y
> CONFIG_FOO=m
> 
> Tristate choice statements can also exhibit the problem, due to having an
> implicit rev_dep (select) containing "m".
> 
> The problem is that MODULES is never evaluted in conf_read_simple() unless
> there's a .config. The following patch fixes this.
> 
> Signed-off-by: Ulf Magnusson <ulfalizer.lkml@gmail.com>
> 
> diff -uNr linux.vanilla/scripts/kconfig/confdata.c linux.new/scripts/kconfig/confdata.c
> --- linux.vanilla/scripts/kconfig/confdata.c	2010-07-27 16:47:43.443006287 +0200
> +++ linux.new/scripts/kconfig/confdata.c	2010-07-27 16:50:19.795005537 +0200
> @@ -170,8 +170,10 @@
>  		if (in)
>  			goto load;
>  		sym_add_change_count(1);
> -		if (!sym_defconfig_list)
> +		if (!sym_defconfig_list) {
> +			sym_calc_value(modules_sym);
>  			return 1;
> +		}
>  
>  		for_all_defaults(sym_defconfig_list, prop) {
>  			if (expr_calc_value(prop->visible.expr) == no ||

Silly error in the patch. The correct patch follows.

Signed-off-by: Ulf Magnusson <ulfalizer.lkml@gmail.com>

diff -uNr linux.vanilla/scripts/kconfig/confdata.c linux.new/scripts/kconfig/confdata.c
--- linux.vanilla/scripts/kconfig/confdata.c	2010-07-27 16:47:43.443006287 +0200
+++ linux.new/scripts/kconfig/confdata.c	2010-07-27 21:48:07.471550551 +0200
@@ -170,8 +170,11 @@
 		if (in)
 			goto load;
 		sym_add_change_count(1);
-		if (!sym_defconfig_list)
+		if (!sym_defconfig_list) {
+			if (modules_sym)
+				sym_calc_value(modules_sym);
 			return 1;
+		}
 
 		for_all_defaults(sym_defconfig_list, prop) {
 			if (expr_calc_value(prop->visible.expr) == no ||

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.35-rc6] kconfig: fix MODULES-related bug in case of no .config
  2010-07-27 19:57 ` Ulf Magnusson
@ 2010-07-28  6:23   ` Américo Wang
  2010-07-29 14:54     ` Michal Marek
  0 siblings, 1 reply; 4+ messages in thread
From: Américo Wang @ 2010-07-28  6:23 UTC (permalink / raw)
  To: Ulf Magnusson; +Cc: linux-kbuild, linux-kernel

On Tue, Jul 27, 2010 at 09:57:43PM +0200, Ulf Magnusson wrote:
>On Tue, Jul 27, 2010 at 09:27:27PM +0200, Ulf Magnusson wrote:
>> Hi,
>> 
>> There seems to be a kconfig bug due to MODULES not always being evaluated if no
>> .config is found. Take the following Kconfig as an example:
>> 
>> config MODULES
>> 	def_bool y
>> 
>> config FOO
>> 	def_tristate m
>> 
>> With no .config, the following configuration is generated:
>> 
>> CONFIG_MODULES=y
>> CONFIG_FOO=y
>> 
>> With an empty .config, the following:
>> 
>> CONFIG_MODULES=y
>> CONFIG_FOO=m
>> 
>> Tristate choice statements can also exhibit the problem, due to having an
>> implicit rev_dep (select) containing "m".
>> 
>> The problem is that MODULES is never evaluted in conf_read_simple() unless
>> there's a .config. The following patch fixes this.

<snip>

>
>Silly error in the patch. The correct patch follows.
>
>Signed-off-by: Ulf Magnusson <ulfalizer.lkml@gmail.com>
>

Sounds good for me.

Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>


>diff -uNr linux.vanilla/scripts/kconfig/confdata.c linux.new/scripts/kconfig/confdata.c
>--- linux.vanilla/scripts/kconfig/confdata.c	2010-07-27 16:47:43.443006287 +0200
>+++ linux.new/scripts/kconfig/confdata.c	2010-07-27 21:48:07.471550551 +0200
>@@ -170,8 +170,11 @@
> 		if (in)
> 			goto load;
> 		sym_add_change_count(1);
>-		if (!sym_defconfig_list)
>+		if (!sym_defconfig_list) {
>+			if (modules_sym)
>+				sym_calc_value(modules_sym);
> 			return 1;
>+		}
> 
> 		for_all_defaults(sym_defconfig_list, prop) {
> 			if (expr_calc_value(prop->visible.expr) == no ||
>--
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.35-rc6] kconfig: fix MODULES-related bug in case of no .config
  2010-07-28  6:23   ` Américo Wang
@ 2010-07-29 14:54     ` Michal Marek
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Marek @ 2010-07-29 14:54 UTC (permalink / raw)
  To: Américo Wang; +Cc: Ulf Magnusson, linux-kbuild, linux-kernel

On Wed, Jul 28, 2010 at 02:23:13PM +0800, Américo Wang wrote:
> On Tue, Jul 27, 2010 at 09:57:43PM +0200, Ulf Magnusson wrote:
> >On Tue, Jul 27, 2010 at 09:27:27PM +0200, Ulf Magnusson wrote:
> >> Hi,
> >> 
> >> There seems to be a kconfig bug due to MODULES not always being evaluated if no
> >> .config is found. Take the following Kconfig as an example:
> >> 
> >> config MODULES
> >> 	def_bool y
> >> 
> >> config FOO
> >> 	def_tristate m
> >> 
> >> With no .config, the following configuration is generated:
> >> 
> >> CONFIG_MODULES=y
> >> CONFIG_FOO=y
> >> 
> >> With an empty .config, the following:
> >> 
> >> CONFIG_MODULES=y
> >> CONFIG_FOO=m
> >> 
> >> Tristate choice statements can also exhibit the problem, due to having an
> >> implicit rev_dep (select) containing "m".
> >> 
> >> The problem is that MODULES is never evaluted in conf_read_simple() unless
> >> there's a .config. The following patch fixes this.
> 
> <snip>
> 
> >
> >Silly error in the patch. The correct patch follows.

Even the previous patch was correct, sym_calc_value() does nothing if
the argument is NULL.

> >
> >Signed-off-by: Ulf Magnusson <ulfalizer.lkml@gmail.com>
> >
> 
> Sounds good for me.
> 
> Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>

Thanks. Added for  2.6.36 to kbuild-2.6.git (this is not a .35
regression AFAICS).

Michal

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-29 14:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27 19:27 [PATCH 2.6.35-rc6] kconfig: fix MODULES-related bug in case of no .config Ulf Magnusson
2010-07-27 19:57 ` Ulf Magnusson
2010-07-28  6:23   ` Américo Wang
2010-07-29 14:54     ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox