Re: Linux 2.6.26-rc1

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Stefan Richter
Date: Thursday, May 8, 2008 - 7:11 am

Mauro Carvalho Chehab wrote:

Which I just wrote is dangerous.  It is easy to get wrong, and it is not
maintainable.

Here is what I would do:

config TUNER_1
	tristate "Tuner 1"
	depends on ACTUAL_DEP1_OF_T1 && ACTUAL_DEP2_OF_T1

config TUNER_2
	tristate "Tuner 2"
	depends on ACTUAL_DEP1_OF_T2 && ACTUAL_DEP2_OF_T2
	select ACTUAL_DEP3_OF_T2

In this example, ACTUAL_DEP3_OF_T2 does not have further dependencies
itself.

And if you believe that Kconfig should assist with runtime dependencies
too, not just build-time dependencies, and you believe that the "help"
and "comment" directives are insufficient for that, then add
meta-options like this:

config META_TUNER_A
	tristate "Meta-tuner A"
	select TUNER_1
	depends on ACTUAL_DEP1_OF_T1 && ACTUAL_DEP2_OF_T1  # for TUNER_1
	select TUNER_2
	depends on ACTUAL_DEP1_OF_T2 && ACTUAL_DEP2_OF_T2  # for TUNER_2
	select ACTUAL_DEP3_OF_T2                           # for TUNER_2
	help
	  Adds support for cards which contain tuner 1 and/or tuner 2.

So, like I said before, I recommend:

  - If an option has an actual build requirement, state it explicitly
    by "depends on" (or alternatively "select") directly at this option.

    Alternatively, enclose this option or a block of options which
    have identical dependencies in an "if"/ "endif" block, conditional
    on this common dependency.

  - Whenever you use "select", *copy* all dependencies of option A to
    option B if B selects A.

    Alternatively, replace "select" by "select ... if C" and *copy*
    all dependencies of option A to option C.

This is because the Kconfig files (1.) must correctly state all build
dependencies and (2.) must be maintainable.

If you "select" a lot, you will have of course a lot of dependencies to
copy.  That's the nature of "select".  You can't get around that.  Not
as long as there is no "select" which recursively checks and maybe
selects dependencies of dependencies.
-- 
Stefan Richter
-=====-==--- -=-= -=---
http://arcgraph.de/sr/
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Linux 2.6.26-rc1, Linus Torvalds, (Sat May 3, 12:38 pm)
Re: Linux 2.6.26-rc1, Alistair John Strachan, (Sat May 3, 2:47 pm)
Re: Linux 2.6.26-rc1, Alistair John Strachan, (Sat May 3, 2:53 pm)
[patch] sysfs: build fix, Ingo Molnar, (Sun May 4, 12:29 am)
Re: Linux 2.6.26-rc1, Robin Holt, (Sun May 4, 5:30 am)
Re: Linux 2.6.26-rc1, Alistair John Strachan, (Sun May 4, 6:56 am)
Re: Linux 2.6.26-rc1, Robin Holt, (Sun May 4, 9:09 am)
Re: Linux 2.6.26-rc1, Alistair John Strachan, (Sun May 4, 9:33 am)
Re: Linux 2.6.26-rc1, Jan Engelhardt, (Sun May 4, 11:40 am)
Re: Linux 2.6.26-rc1, Andreas Mohr, (Sun May 4, 10:39 pm)
Re: Linux 2.6.26-rc1, Ingo Molnar, (Mon May 5, 12:30 am)
Re: Linux 2.6.26-rc1, Mauro Carvalho Chehab, (Mon May 5, 1:14 pm)
Re: Linux 2.6.26-rc1, Mauro Carvalho Chehab, (Mon May 5, 2:04 pm)
Re: Linux 2.6.26-rc1, Stephen Rothwell, (Mon May 5, 4:51 pm)
Re: Linux 2.6.26-rc1, David Miller, (Mon May 5, 4:55 pm)
Re: Linux 2.6.26-rc1, Andrew Morton, (Mon May 5, 5:16 pm)
Re: Linux 2.6.26-rc1, Ingo Molnar, (Mon May 5, 5:17 pm)
Re: Linux 2.6.26-rc1, Ingo Molnar, (Mon May 5, 5:21 pm)
Re: Linux 2.6.26-rc1, Stephen Rothwell, (Mon May 5, 10:35 pm)
Re: Linux 2.6.26-rc1, Stephen Rothwell, (Mon May 5, 10:48 pm)
Re: Linux 2.6.26-rc1, Stephen Rothwell, (Mon May 5, 10:57 pm)
Re: Linux 2.6.26-rc1, David Miller, (Mon May 5, 11:56 pm)
Re: Linux 2.6.26-rc1, Stephen Rothwell, (Tue May 6, 12:26 am)
Re: Linux 2.6.26-rc1, Alistair John Strachan, (Tue May 6, 1:02 am)
Re: Linux 2.6.26-rc1, Mauro Carvalho Chehab, (Tue May 6, 3:31 am)
Re: Linux 2.6.26-rc1, Ingo Molnar, (Tue May 6, 6:07 am)
Re: Scheduling problems ? [ Was: Linux 2.6.26-rc1 ], Ingo Molnar, (Tue May 6, 6:11 am)
Re: Linux 2.6.26-rc1, Stefan Richter, (Tue May 6, 7:34 am)
Re: Linux 2.6.26-rc1, Stefan Richter, (Tue May 6, 7:54 am)
Re: Linux 2.6.26-rc1, Mauro Carvalho Chehab, (Tue May 6, 12:13 pm)
Re: Linux 2.6.26-rc1, Stefan Richter, (Tue May 6, 12:44 pm)
Re: Linux 2.6.26-rc1, Mauro Carvalho Chehab, (Tue May 6, 1:06 pm)
Re: Linux 2.6.26-rc1, Stefan Richter, (Tue May 6, 1:47 pm)
Re: Linux 2.6.26-rc1, Mauro Carvalho Chehab, (Tue May 6, 3:39 pm)
Re: Linux 2.6.26-rc1, Stefan Richter, (Tue May 6, 4:36 pm)
Re: Linux 2.6.26-rc1, Stefan Richter, (Tue May 6, 4:48 pm)
Re: Linux 2.6.26-rc1, Ingo Molnar, (Wed May 7, 1:35 am)
Re: Linux 2.6.26-rc1, Mauro Carvalho Chehab, (Thu May 8, 5:48 am)
Re: Linux 2.6.26-rc1, Stefan Richter, (Thu May 8, 7:11 am)