mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] Re: 2.4.6p6: dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-07-02  2:25 Adam J. Richter
  2001-07-02  2:48 ` Keith Owens
  0 siblings, 1 reply; 21+ messages in thread
From: Adam J. Richter @ 2001-07-02  2:25 UTC (permalink / raw)
  To: kaos, rhw; +Cc: linux-kernel, rmk

	Does anyone know if there is any code that would break if
we put quotation marks around the $CONFIG_xxxx references in the
dep_xxx commands in all of the Config.in files?  In other words,
change all commands of the form

dep_tristate  CONFIG_FOO 'Foo on x86/pci machines'  $CONFIG_PCI $CONFIG_X86

to

dep_tristate  CONFIG_FOO 'Foo on x86/pci machines'  "$CONFIG_PCI" "$CONFIG_X86"

      Then, we could change dep_{bool,tristate} to only treat "" as "n",
in its dependency parameters without effecting how undefined variables
are treated elsewhere.  For example, CONFIG_FOO being undefined would
still cause "make oldconfig" to treat it as "NEW" and ask the user
about it.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."


^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: [PATCH] Re: 2.4.6p6: dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-07-02  9:29 Adam J. Richter
  0 siblings, 0 replies; 21+ messages in thread
From: Adam J. Richter @ 2001-07-02  9:29 UTC (permalink / raw)
  To: kaos; +Cc: alan, linux-kernel, rhw, rmk

Keith,

	Copping out with "not my job" and then demanding essentially a
mathematical proof of correctness is unpersuasive, but I have no
objection to your change (some select "define_bool xxx no" lines in
a common file that every architecture reads), as long as we have
established that it seems to get along with "make xconfig" after all.
If that is the case, then I'd be just as happy that Linus apply your patch.

	So, with that lame endorsement and nobody else still objecting
to your patch (right?), how about if you submit your patch to Linus,
or is there some other way you want to proceed?

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: [PATCH] Re: 2.4.6p6: dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-07-02  6:03 Adam J. Richter
  0 siblings, 0 replies; 21+ messages in thread
From: Adam J. Richter @ 2001-07-02  6:03 UTC (permalink / raw)
  To: kaos; +Cc: alan, linux-kernel, rhw, rmk

I have minor correction to make.  I wrote:
>        In linux-2.4.6-pre8, there are only three configuration variables
>that are defined with an indented 'define_bool' statement
>(CONFIG_BLK_DEV_IDE{DMA,PCI}, and CONFIG_PCI),

I meant three configuration variables that are defined with an
indented 'define_bool' statement _and are used as arguments to
a dep_* command_.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: [PATCH] Re: 2.4.6p6: dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-07-02  5:52 Adam J. Richter
  2001-07-02  6:21 ` Keith Owens
  2001-07-02 10:14 ` Alan Cox
  0 siblings, 2 replies; 21+ messages in thread
From: Adam J. Richter @ 2001-07-02  5:52 UTC (permalink / raw)
  To: kaos; +Cc: alan, linux-kernel, rhw, rmk

>On Sun, 1 Jul 2001 21:46:04 -0700, 
>"Adam J. Richter" <adam@yggdrasil.com> wrote:
>>Can you even write a hypothetical example?

>if [ "$CONFIG_foo" = "n" -a "$CONFIG_bar" = "n" ]; then
>  define_bool "$CONFIG_ALLOW_foo_bar n
>fi
>....
>dep_tristate CONFIG_baz $CONFIG_ALLOW_foo_bar

	In linux-2.4.6-pre8, there are only three configuration variables
that are defined with an indented 'define_bool' statement
(CONFIG_BLK_DEV_IDE{DMA,PCI}, and CONFIG_PCI), and the conditional
code execute by all "if" statements in all of the config.in files
appears to be indented (or at least the first statement in the block
is indented).  None of these three variables has the semantics that
I think you you described above.

	If you want to check, I determined this by the following shell
commands:

% find . -iname config.in | xargs egrep dep_tristate | tr '   ' '\n\n' | egrep '^\$CONFIG_' | sort -u > /tmp/config-dependencies 
% find . -iname config.in | xargs egrep '^[   ].*define_bool' | fgrep -f /tmp/config-dependencies  | awk '{print $(NF-1)}' | sort -u
CONFIG_BLK_DEV_IDEDMA
CONFIG_BLK_DEV_IDEPCI
CONFIG_PCI
% find /usr/src/linux/ -iname config.in | xargs egrep -A 2 ^if | egrep -v -e -- | egrep '^-[^         ]'
%
 

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: [PATCH] Re: 2.4.6p6: dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-07-02  4:46 Adam J. Richter
  2001-07-02  4:51 ` Keith Owens
  0 siblings, 1 reply; 21+ messages in thread
From: Adam J. Richter @ 2001-07-02  4:46 UTC (permalink / raw)
  To: kaos; +Cc: alan, linux-kernel, rhw, rmk

>>>>       Does anyone know if there is any code that would break if
>>>>we put quotation marks around the $CONFIG_xxxx references in the
>>>>dep_xxx commands in all of the Config.in files?

>>>That has the same problem that AC was worried about.  Variables that
>>>used to be treated as "undefined, don't care" are now treated as
>>>"undefined, assume n and forbid".

>>	What variables?  Please show me a real example.

>Not my job.  If you want to make a global change to the meaning of
>undefined config variables, it is your responsibility to show that the
>change has no unwanted side effects.  Assuming there are no side
>effects is unsatisfactory in a stable kernel, especially with all the
>config variables in patch sets outside the kernel.

	That's not reasonable in the face of what appears to be
completely fabricated myth.  You generally can't prove this
kind of a negative for anything.  Either you or Alan Cox should
show an example.  Can you even show me the code that such an
example would exercise.  Can you even write a hypothetical example?

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: [PATCH] Re: 2.4.6p6: dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-07-02  3:34 Adam J. Richter
  0 siblings, 0 replies; 21+ messages in thread
From: Adam J. Richter @ 2001-07-02  3:34 UTC (permalink / raw)
  To: kaos; +Cc: linux-kernel, rhw, rmk

Keith Owens <kaos@ocs.com.au> writes:
>On Sun, 1 Jul 2001 19:25:11 -0700, 
>"Adam J. Richter" <adam@yggdrasil.com> wrote:
>>	Does anyone know if there is any code that would break if
>>we put quotation marks around the $CONFIG_xxxx references in the
>>dep_xxx commands in all of the Config.in files?

>That has the same problem that AC was worried about.  Variables that
>used to be treated as "undefined, don't care" are now treated as
>"undefined, assume n and forbid".

	What variables?  Please show me a real example.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: 2.4.6p6: numerous dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-07-01  3:00 Keith Owens
  2001-07-01 23:04 ` [PATCH] Re: 2.4.6p6: " Riley Williams
  0 siblings, 1 reply; 21+ messages in thread
From: Keith Owens @ 2001-07-01  3:00 UTC (permalink / raw)
  To: Riley Williams; +Cc: Russell King, Adam J Richter, Linux Kernel

On Sat, 30 Jun 2001 21:36:26 +0100 (BST), 
Riley Williams <rhw@MemAlpha.CX> wrote:
> 1. Adam's point is that there are dep_* statements in the config
>    setup that have been used to say that a particular option is
>    dependant upon a particular architecture, but this doesn't work.
>
> 3. MY understanding of the situation is that ALL architecture
>    specific config lines are EXPECTED to be in the arch/*/config.in
>    files, where they will only even be seen when the relevant
>    architecture is being compiled for.
>
>As a result of this, I would summarise this discussion as saying that
>there is a bug in the kernel config scripts in that some options that
>should be located in the architecture-specific config files are in the
>all-architecture config files instead.

(1) and (3) are correct but your conclusion is not.  The problem is

  dep_tristate CONFIG_some_driver $CONFIG_some_arch

where the intention is to allow the driver only if some_arch is set.
When you compile for some_other_arch, CONFIG_some_arch is undefined.
dep_tristate treats undefined variables as "don't care" and we cannot
fix that without changing bash or a major rewrite of the shell scripts.
There are two solutions, either change all such lines to

  if [ "$CONFIG_some_arch" = "y" ];then
    tristate CONFIG_some_driver
  fi

or

  define_bool CONFIG_some_arch n

for all architectures at the start, followed by turning on the one that
is required.

Lots of if statements are messy and they will not prevent somebody
adding new options with exactly the same problem.  Explicitly setting
all but one arch variable to 'n' results in cleaner config scripts and
new arch dependent driver settings will automatically work.


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

end of thread, other threads:[~2001-07-02 16:29 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-02  2:25 [PATCH] Re: 2.4.6p6: dep_{bool,tristate} $CONFIG_ARCH_xxx bugs Adam J. Richter
2001-07-02  2:48 ` Keith Owens
2001-07-02  7:22   ` Riley Williams
  -- strict thread matches above, loose matches on Subject: below --
2001-07-02  9:29 Adam J. Richter
2001-07-02  6:03 Adam J. Richter
2001-07-02  5:52 Adam J. Richter
2001-07-02  6:21 ` Keith Owens
2001-07-02 10:14 ` Alan Cox
2001-07-02  4:46 Adam J. Richter
2001-07-02  4:51 ` Keith Owens
2001-07-02  9:29   ` Andrzej Krzysztofowicz
2001-07-02  3:34 Adam J. Richter
2001-07-01  3:00 2.4.6p6: numerous " Keith Owens
2001-07-01 23:04 ` [PATCH] Re: 2.4.6p6: " Riley Williams
2001-07-02  0:39   ` Keith Owens
2001-07-02  7:16     ` Riley Williams
2001-07-02  7:23       ` Keith Owens
2001-07-02  8:25         ` Riley Williams
2001-07-02  9:41           ` Russell King
2001-07-02 12:40             ` Riley Williams
2001-07-02 15:03               ` Russell King
2001-07-02 16:28                 ` Nicolas Pitre

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®