mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Bug in "select" dependency checking?
@ 2004-02-06  0:37 Andreas Gruenbacher
  2004-02-06 14:00 ` Roman Zippel
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Gruenbacher @ 2004-02-06  0:37 UTC (permalink / raw)
  To: Roman Zippel; +Cc: kbuild-devel, lkml

Hello,

I think the dependency check in scripts/kconfig/symbol.c has a bug
related to "select", but possibly it's only a misunderstanding what
select is supposed to do. I have the following symbols and dependencies
(simplified):


  config NFS_ACL_SUPPORT
	tristate

  config NFSD
	tristate "..."
	select NFS_ACL_SUPPORT if NFSD_ACL	

  config NFSD_V3
	bool "..."
	depends on NFSD

  config NFSD_ACL
	bool "..."
	depends on NFSD_V3

  config NFS_FS
	tristate "..."
	select NFS_ACL_SUPPORT if NFS_ACL

  config NFS_V3
	bool "..."
	depends on NFS_FS

  config NFS_ACL
	bool "..."
	depends on NFS_V3


The intention of this is as follows: NFS_ACL_SUPPORT is a symbol without
menu entry. It activates an object which is either a module or linked
into the kernel. It is needed if NFSD_ACL is y or NFS_ACL is y. When it
is needed, it should have max(NFSD,NFS_FS).

With this configuration, menuconf gives me this message (among others):

  Warning! Found recursive dependency: NFSD_V3 NFSD_ACL NFSD NFSD_V3

In my understanding, the select statement does not cause a dependency of
NFSD on NFSD_ACL. I can write the same thing without selects as follows:

  config NFS_ACL_SUPPORT
        tristate
        default y if (NFSD=y || NFS_FS=y) && (NFSD_ACL || NFS_ACL)
        default m if (NFSD!=y && NFS_FS!=y) && (NFSD=m || NFS_FS=m) &&
		     (NFSD_ACL || NFS_ACL)

Any thoughts?


Cheers,
-- 
Andreas Gruenbacher <agruen@suse.de>
SUSE Labs, SUSE LINUX AG


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

* Re: Bug in "select" dependency checking?
  2004-02-06  0:37 Bug in "select" dependency checking? Andreas Gruenbacher
@ 2004-02-06 14:00 ` Roman Zippel
  2004-02-06 14:49   ` Andreas Gruenbacher
  0 siblings, 1 reply; 4+ messages in thread
From: Roman Zippel @ 2004-02-06 14:00 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: kbuild-devel, lkml

Hi,

On Fri, 6 Feb 2004, Andreas Gruenbacher wrote:

> With this configuration, menuconf gives me this message (among others):
>
>   Warning! Found recursive dependency: NFSD_V3 NFSD_ACL NFSD NFSD_V3

This is indeed a wrong positive, the patch below fixes this, but you if
change your config into e.g.:

config NFSD_ACL
	bool "..."
	depends on NFSD_V3
	select NFS_ACL_SUPPORT if NFSD

you avoid the warning and it does the same.

> In my understanding, the select statement does not cause a dependency of
> NFSD on NFSD_ACL. I can write the same thing without selects as follows:
>
>   config NFS_ACL_SUPPORT
>         tristate
>         default y if (NFSD=y || NFS_FS=y) && (NFSD_ACL || NFS_ACL)
>         default m if (NFSD!=y && NFS_FS!=y) && (NFSD=m || NFS_FS=m) &&
> 		     (NFSD_ACL || NFS_ACL)

Or you could also write this simpler as:

config NFS_ACL_SUPPORT
	tristate
	default (NFSD && NFSD_ACL) || (NFS_FS && NFS_ACL)

bye, Roman

Index: scripts/kconfig/symbol.c
===================================================================
RCS file: /home/other/cvs/linux/linux-2.6/scripts/kconfig/symbol.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 symbol.c
--- scripts/kconfig/symbol.c	9 Sep 2003 08:33:49 -0000	1.1.1.2
+++ scripts/kconfig/symbol.c	6 Feb 2004 13:51:39 -0000
@@ -706,7 +706,7 @@ struct symbol *sym_check_deps(struct sym
 		goto out;

 	for (prop = sym->prop; prop; prop = prop->next) {
-		if (prop->type == P_CHOICE)
+		if (prop->type == P_CHOICE || prop->type == P_SELECT)
 			continue;
 		sym2 = sym_check_expr_deps(prop->visible.expr);
 		if (sym2)

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

* Re: Bug in "select" dependency checking?
  2004-02-06 14:00 ` Roman Zippel
@ 2004-02-06 14:49   ` Andreas Gruenbacher
  2004-02-07 22:03     ` Roman Zippel
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Gruenbacher @ 2004-02-06 14:49 UTC (permalink / raw)
  To: Roman Zippel; +Cc: kbuild-devel, lkml

On Fri, 2004-02-06 at 15:00, Roman Zippel wrote:
> Hi,
> 
> On Fri, 6 Feb 2004, Andreas Gruenbacher wrote:
> 
> > With this configuration, menuconf gives me this message (among others):
> >
> >   Warning! Found recursive dependency: NFSD_V3 NFSD_ACL NFSD NFSD_V3
> 
> This is indeed a wrong positive, the patch below fixes this, but you if
> change your config into e.g.:
> 
> config NFSD_ACL
> 	bool "..."
> 	depends on NFSD_V3
> 	select NFS_ACL_SUPPORT if NFSD
>
> you avoid the warning and it does the same.

Does it? I would assume this to limit NFS_ACL_SUPPORT to y or n
depending on the value of NFSD_ACL. If should be y, m or n depending on
the value of NFSD.

> Or you could also write this simpler as:
> 
> config NFS_ACL_SUPPORT
> 	tristate
> 	default (NFSD && NFSD_ACL) || (NFS_FS && NFS_ACL)

That's much more elegant than my "handwired" version. But I prefer
select: NFSD_ACL and NFS_ACL are in different patches; with select, the
patches don't conflict with each other.


Thanks,
-- 
Andreas Gruenbacher <agruen@suse.de>
SUSE Labs, SUSE LINUX AG


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

* Re: Bug in "select" dependency checking?
  2004-02-06 14:49   ` Andreas Gruenbacher
@ 2004-02-07 22:03     ` Roman Zippel
  0 siblings, 0 replies; 4+ messages in thread
From: Roman Zippel @ 2004-02-07 22:03 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: kbuild-devel, lkml

Hi,

On Fri, 6 Feb 2004, Andreas Gruenbacher wrote:

> > config NFSD_ACL
> > 	bool "..."
> > 	depends on NFSD_V3
> > 	select NFS_ACL_SUPPORT if NFSD
> >
> > you avoid the warning and it does the same.
>
> Does it? I would assume this to limit NFS_ACL_SUPPORT to y or n
> depending on the value of NFSD_ACL. If should be y, m or n depending on
> the value of NFSD.

That's what the "if NFSD" part does, it's added to the expression and so
modifies how NFS_ACL_SUPPORT is selected. If you enable the debug options
in xconfig you can see the generated expression, which is used to
calculate the final value.
While looking at this, I noticed that a bit too much is added, the NFSD_V3
dependency is also added, but it belongs to NFSD_ACL, otherwise it can
also unintentionally turn the bool into a tristate. I'll have to fix
this...

bye, Roman

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

end of thread, other threads:[~2004-02-07 22:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-06  0:37 Bug in "select" dependency checking? Andreas Gruenbacher
2004-02-06 14:00 ` Roman Zippel
2004-02-06 14:49   ` Andreas Gruenbacher
2004-02-07 22:03     ` Roman Zippel

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

all inboxes | Powered by JetHome®