linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trent Piepho <xyzzy@speakeasy.org>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: "Jan Engelhardt" <jengelh@computergmbh.de>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Linux and Kernel Video" <video4linux-list@redhat.com>,
	"Toralf Förster" <toralf.foerster@gmx.de>,
	"Luca Risolia" <luca.risolia@studio.unibo.it>,
	LKML <linux-kernel@vger.kernel.org>,
	"Roman Zippel" <zippel@linux-m68k.org>,
	"Satyam Sharma" <satyam.sharma@gmail.com>,
	"Andreas Herrmann" <andreas.herrmann3@amd.com>,
	"Oliver Neukum" <oneukum@suse.de>
Subject: Re: [patch] 2.6.22-rc Kconfig troubles when using menuconfig
Date: Sat, 23 Jun 2007 17:14:57 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0706231648290.4914@shell4.speakeasy.net> (raw)
In-Reply-To: <1182637586.10174.36.camel@gaivota>

On Sat, 23 Jun 2007, Mauro Carvalho Chehab wrote:
> Your patch seems OK to me, providing that we also add the Andreas patch:

>--- a/drivers/net/Kconfig
>+++ b/drivers/net/Kconfig
>menuconfig NETDEV_1000
>-	bool "Ethernet (1000 Mbit)"
>+	tristate "Ethernet (1000 Mbit)"
> 	depends on !UML
>-	default y
>
> menuconfig NETDEV_10000
>-	bool "Ethernet (10000 Mbit)"
>+	tristate "Ethernet (10000 Mbit)"
> 	depends on !UML
>-	default y

I don't think this part is necessary.  The only thing NETDEV_1000[0]
depend on is UML, which is a boolean.

Here is an alternate patch for this issue.  I fix it by adding the
dependencies of the menuconfig to the "if / endif" block the menuconfig
controls.  That way the menu doesn't turn into a tristate, which doesn't
make a lot of sense.  How can the menu be compiled as a module, when there
is no code associated with it?

------------------------------------------------------------------
Fix Kconfig dependency problems wrt boolean menuconfigs

If one has a dependency chain (tristate)FOO depends on (bool)BAR depends on
(tristate)BAZ, build problems will result.  If BAZ=m, then BAR can be set y,
which allows FOO=y.  It's possible to have FOO=y && BAZ=m, which wouldn't be
allowed if FOO depended directly on BAZ.  In effect, the bool promotes the
tristate from m to y.

This ends up causing a problem with several menuconfigs that look like:

menuconfig BAR
	bool
	depends on BAZ [tristate]
if BAR
config FOO
	tristate
endif

The solution used here is to add the dependencies of BAR to the if statement,
so that items in the if block will gain a direct non-bool-promoted dependency
on BAZ.  This is how it would work if a menu was used instead of an if block.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>

diff -r dfbe7cc4e21e drivers/atm/Kconfig
--- a/drivers/atm/Kconfig	Thu Jun 21 16:02:50 2007 -0700
+++ b/drivers/atm/Kconfig	Sat Jun 23 16:41:05 2007 -0700
@@ -7,7 +7,7 @@ menuconfig ATM_DRIVERS
 	depends on NETDEVICES && ATM
 	default y

-if ATM_DRIVERS
+if ATM_DRIVERS && NETDEVICES && ATM

 config ATM_DUMMY
 	tristate "Dummy ATM driver"
diff -r dfbe7cc4e21e drivers/media/dvb/Kconfig
--- a/drivers/media/dvb/Kconfig	Thu Jun 21 16:02:50 2007 -0700
+++ b/drivers/media/dvb/Kconfig	Sat Jun 23 16:42:28 2007 -0700
@@ -11,7 +11,7 @@ menuconfig DVB_CAPTURE_DRIVERS
 	---help---
 	  Say Y to select Digital TV adapters

-if DVB_CAPTURE_DRIVERS
+if DVB_CAPTURE_DRIVERS && DVB_CORE

 comment "Supported SAA7146 based PCI Adapters"
 	depends on DVB_CORE && PCI && I2C
diff -r dfbe7cc4e21e drivers/media/radio/Kconfig
--- a/drivers/media/radio/Kconfig	Thu Jun 21 16:02:50 2007 -0700
+++ b/drivers/media/radio/Kconfig	Sat Jun 23 16:42:44 2007 -0700
@@ -9,7 +9,7 @@ menuconfig RADIO_ADAPTERS
 	---help---
 	  Say Y here to enable selecting AM/FM radio adapters.

-if RADIO_ADAPTERS
+if RADIO_ADAPTERS && VIDEO_DEV

 config RADIO_CADET
 	tristate "ADS Cadet AM/FM Tuner"
diff -r dfbe7cc4e21e drivers/media/video/Kconfig
--- a/drivers/media/video/Kconfig	Thu Jun 21 16:02:50 2007 -0700
+++ b/drivers/media/video/Kconfig	Sat Jun 23 17:10:17 2007 -0700
@@ -11,7 +11,7 @@ menuconfig VIDEO_CAPTURE_DRIVERS
 	  webcams, analog TV, and hybrid analog/digital TV.
 	  Some of those devices also supports FM radio.

-if VIDEO_CAPTURE_DRIVERS
+if VIDEO_CAPTURE_DRIVERS && VIDEO_DEV

 config VIDEO_ADV_DEBUG
 	bool "Enable advanced debug functionality"
@@ -347,7 +347,7 @@ endmenu # encoder / decoder chips

 config VIDEO_VIVI
 	tristate "Virtual Video Driver"
-	depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 && PCI && VIDEO_DEV
+	depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 && PCI
 	select VIDEO_BUF
 	default n
 	---help---
@@ -691,7 +691,7 @@ menuconfig V4L_USB_DRIVERS
 	depends on USB
 	default y

-if V4L_USB_DRIVERS
+if V4L_USB_DRIVERS && USB

 source "drivers/media/video/pvrusb2/Kconfig"

diff -r dfbe7cc4e21e drivers/net/pcmcia/Kconfig
--- a/drivers/net/pcmcia/Kconfig	Thu Jun 21 16:02:50 2007 -0700
+++ b/drivers/net/pcmcia/Kconfig	Sat Jun 23 16:45:44 2007 -0700
@@ -19,7 +19,7 @@ menuconfig NET_PCMCIA

 	  If unsure, say N.

-if NET_PCMCIA
+if NET_PCMCIA && PCMCIA

 config PCMCIA_3C589
 	tristate "3Com 3c589 PCMCIA support"

      reply	other threads:[~2007-06-24  0:15 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200706211117.55908.toralf.foerster@gmx.de>
     [not found] ` <200706211231.53898.luca.risolia@studio.unibo.it>
     [not found]   ` <200706211326.45031.toralf.foerster@gmx.de>
     [not found]     ` <200706211350.14526.oneukum@suse.de>
2007-06-22 13:22       ` Kconfig troubles when using menuconfig - Was: [patch]Re: [linux-usb-devel] linux-2.6.22-rc5-gf1518a0 build #300 failed in zc0301_core.c Mauro Carvalho Chehab
2007-06-22 13:46         ` Andreas Herrmann
2007-06-22 13:51           ` Jan Engelhardt
2007-06-22 14:23             ` Andreas Herrmann
2007-06-22 15:03             ` Mauro Carvalho Chehab
2007-06-22 15:32               ` Andreas Herrmann
2007-06-22 15:45               ` Oliver Neukum
2007-06-22 14:27         ` Roman Zippel
2007-06-22 15:18           ` Jan Engelhardt
2007-06-22 16:24             ` Roman Zippel
2007-06-22 16:42               ` Jan Engelhardt
2007-06-22 20:17                 ` Satyam Sharma
2007-06-22 21:00                   ` Satyam Sharma
2007-06-22 15:21           ` Mauro Carvalho Chehab
2007-06-22 16:31             ` Roman Zippel
2007-06-22 20:20         ` Trent Piepho
2007-06-22 21:20           ` Satyam Sharma
2007-06-22 21:45             ` Roman Zippel
2007-06-22 22:01               ` Satyam Sharma
2007-06-22 22:21                 ` Roman Zippel
2007-06-22 22:33                   ` Satyam Sharma
2007-06-22 23:12                     ` Roman Zippel
2007-06-22 23:26                       ` Satyam Sharma
2007-06-22 23:39                         ` Roman Zippel
2007-06-22 23:49                           ` Satyam Sharma
2007-06-23  0:26                             ` Roman Zippel
2007-06-23  6:57                               ` Jan Engelhardt
2007-06-25  0:11                                 ` Roman Zippel
2007-06-22 22:11             ` Jan Engelhardt
2007-06-23 12:28               ` Kconfig troubles when using menuconfig - Was: [patch]Re: " Oleg Verych
2007-06-23 22:33             ` Kconfig troubles when using menuconfig - Was: [patch]Re: [linux-usb-devel] " Trent Piepho
2007-06-24  3:28               ` Satyam Sharma
2007-06-23  7:20           ` [patch] 2.6.22-rc Kconfig troubles when using menuconfig Jan Engelhardt
2007-06-23 22:26             ` Mauro Carvalho Chehab
2007-06-24  0:14               ` Trent Piepho [this message]

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=Pine.LNX.4.58.0706231648290.4914@shell4.speakeasy.net \
    --to=xyzzy@speakeasy.org \
    --cc=andreas.herrmann3@amd.com \
    --cc=jengelh@computergmbh.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.risolia@studio.unibo.it \
    --cc=mchehab@infradead.org \
    --cc=oneukum@suse.de \
    --cc=satyam.sharma@gmail.com \
    --cc=toralf.foerster@gmx.de \
    --cc=torvalds@linux-foundation.org \
    --cc=video4linux-list@redhat.com \
    --cc=zippel@linux-m68k.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).