All of lore.kernel.org
 help / color / mirror / Atom feed
* Surprising Kconfig depends semantics
@ 2003-08-08 14:44 Adrian Bunk
  2003-08-08 15:13 ` Roman Zippel
  0 siblings, 1 reply; 7+ messages in thread
From: Adrian Bunk @ 2003-08-08 14:44 UTC (permalink / raw)
  To: Roman Zippel; +Cc: linux-kernel

Hi Roman,

I traced some unresolved symbol problems in 2.6.0-test2-mm5 down to the 
following:

drivers/input/keyboard/Kconfig contains the following:

config KEYBOARD_ATKBD
        tristate "AT keyboard support" if EMBEDDED || !X86 
        default y
        depends on INPUT && INPUT_KEYBOARD && SERIO


The .config includes:
  # CONFIG_EMBEDDED is not set
  CONFIG_X86=y
  CONFIG_INPUT=y
  CONFIG_INPUT_KEYBOARD=y
  CONFIG_SERIO=m

Kconfig sets
  CONFIG_KEYBOARD_ATKBD=y

CONFIG_SERIO=m with CONFIG_KEYBOARD_ATKBD=y shouldn't be a valid 
combination.

The correct solution is most likely a
	default y if INPUT=y && INPUT_KEYBOARD=y && SERIO=y
	default m if INPUT!=n && INPUT_KEYBOARD!=n && SERIO!=n


The semantics that in

config FOO
	tristate
	default y if BAR

FOO will be set to y if BAR=m is a bit surprising.


cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: Surprising Kconfig depends semantics
  2003-08-08 14:44 Surprising Kconfig depends semantics Adrian Bunk
@ 2003-08-08 15:13 ` Roman Zippel
  2003-08-08 16:26   ` James Simmons
  2003-08-08 18:30   ` Adrian Bunk
  0 siblings, 2 replies; 7+ messages in thread
From: Roman Zippel @ 2003-08-08 15:13 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

Hi,

On Fri, 8 Aug 2003, Adrian Bunk wrote:

> CONFIG_SERIO=m with CONFIG_KEYBOARD_ATKBD=y shouldn't be a valid 
> combination.
> 
> The correct solution is most likely a
> 	default y if INPUT=y && INPUT_KEYBOARD=y && SERIO=y
> 	default m if INPUT!=n && INPUT_KEYBOARD!=n && SERIO!=n

This is probably the easiest solution:

	default INPUT_KEYBOARD && SERIO

(INPUT_KEYBOARD already depends on INPUT)

> The semantics that in
> 
> config FOO
> 	tristate
> 	default y if BAR
> 
> FOO will be set to y if BAR=m is a bit surprising.

Why?

bye, Roman


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

* Re: Surprising Kconfig depends semantics
  2003-08-08 15:13 ` Roman Zippel
@ 2003-08-08 16:26   ` James Simmons
  2003-08-08 18:30   ` Adrian Bunk
  1 sibling, 0 replies; 7+ messages in thread
From: James Simmons @ 2003-08-08 16:26 UTC (permalink / raw)
  To: Roman Zippel; +Cc: Adrian Bunk, linux-kernel


> > CONFIG_SERIO=m with CONFIG_KEYBOARD_ATKBD=y shouldn't be a valid 
> > combination.
> > 
> > The correct solution is most likely a
> > 	default y if INPUT=y && INPUT_KEYBOARD=y && SERIO=y
> > 	default m if INPUT!=n && INPUT_KEYBOARD!=n && SERIO!=n
> 
> This is probably the easiest solution:
> 
> 	default INPUT_KEYBOARD && SERIO
> 
> (INPUT_KEYBOARD already depends on INPUT)

This is not the right solution. Not all input keyboard drivers use the 
serio layer. Take alook at amikbd.c in input/keyboard/



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

* Re: Surprising Kconfig depends semantics
  2003-08-08 15:13 ` Roman Zippel
  2003-08-08 16:26   ` James Simmons
@ 2003-08-08 18:30   ` Adrian Bunk
  2003-08-08 18:58     ` Roman Zippel
  1 sibling, 1 reply; 7+ messages in thread
From: Adrian Bunk @ 2003-08-08 18:30 UTC (permalink / raw)
  To: Roman Zippel; +Cc: linux-kernel

On Fri, Aug 08, 2003 at 05:13:48PM +0200, Roman Zippel wrote:

> Hi,

Hi Roman,

> On Fri, 8 Aug 2003, Adrian Bunk wrote:
> 
> > CONFIG_SERIO=m with CONFIG_KEYBOARD_ATKBD=y shouldn't be a valid 
> > combination.
> > 
> > The correct solution is most likely a
> > 	default y if INPUT=y && INPUT_KEYBOARD=y && SERIO=y
> > 	default m if INPUT!=n && INPUT_KEYBOARD!=n && SERIO!=n
> 
> This is probably the easiest solution:
> 
> 	default INPUT_KEYBOARD && SERIO
> 
> (INPUT_KEYBOARD already depends on INPUT)

I'll send a
  default INPUT && INPUT_KEYBOARD && SERIO
patch (to address the things James said, in any cases it doesn't do any 
harm).

But it stays strange that a default can assign a value that isn't 
allowed by the depends, and you therefore have to write the depends 
twice in this case:

config KEYBOARD_ATKBD
        tristate "AT keyboard support" if EMBEDDED || !X86 
        default INPUT && INPUT_KEYBOARD && SERIO
        depends on INPUT && INPUT_KEYBOARD && SERIO


> > The semantics that in
> > 
> > config FOO
> > 	tristate
> > 	default y if BAR
> > 
> > FOO will be set to y if BAR=m is a bit surprising.
> 
> Why?

On a first thought I'd have expected it to be equivalent to
  default y if BAR=y

> bye, Roman

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: Surprising Kconfig depends semantics
  2003-08-08 18:30   ` Adrian Bunk
@ 2003-08-08 18:58     ` Roman Zippel
  2003-08-08 22:45       ` James Simmons
  0 siblings, 1 reply; 7+ messages in thread
From: Roman Zippel @ 2003-08-08 18:58 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

Hi,

On Fri, 8 Aug 2003, Adrian Bunk wrote:

> > This is probably the easiest solution:
> > 
> > 	default INPUT_KEYBOARD && SERIO
> > 
> > (INPUT_KEYBOARD already depends on INPUT)
> 
> I'll send a
>   default INPUT && INPUT_KEYBOARD && SERIO
> patch (to address the things James said, in any cases it doesn't do any 
> harm).

His comment didn't make much sense, INPUT_KEYBOARD is still independent of 
SERIO.

> But it stays strange that a default can assign a value that isn't 
> allowed by the depends, and you therefore have to write the depends 
> twice in this case:
> 
> config KEYBOARD_ATKBD
>         tristate "AT keyboard support" if EMBEDDED || !X86 
>         default INPUT && INPUT_KEYBOARD && SERIO
>         depends on INPUT && INPUT_KEYBOARD && SERIO

The easier solution is probably to force SERIO to 'y' as well, as the 
point of hiding it behind EMBEDDED is to get it compiled into the kernel.

bye, Roman


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

* Re: Surprising Kconfig depends semantics
  2003-08-08 18:58     ` Roman Zippel
@ 2003-08-08 22:45       ` James Simmons
  2003-08-08 23:26         ` Roman Zippel
  0 siblings, 1 reply; 7+ messages in thread
From: James Simmons @ 2003-08-08 22:45 UTC (permalink / raw)
  To: Roman Zippel; +Cc: Adrian Bunk, linux-kernel


> >   default INPUT && INPUT_KEYBOARD && SERIO
> > patch (to address the things James said, in any cases it doesn't do any 
> > harm).
> 
> His comment didn't make much sense, INPUT_KEYBOARD is still independent of 
> SERIO.
....
> The easier solution is probably to force SERIO to 'y' as well, as the 
> point of hiding it behind EMBEDDED is to get it compiled into the kernel.

What I mean is shouldn't build serio by default all the time. USB doesn't 
need it as well as some other drivers like the Amiga keyboard driver.
Serio can also be used by more things than I keyboard driver. Maybe I 
misunderstood?


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

* Re: Surprising Kconfig depends semantics
  2003-08-08 22:45       ` James Simmons
@ 2003-08-08 23:26         ` Roman Zippel
  0 siblings, 0 replies; 7+ messages in thread
From: Roman Zippel @ 2003-08-08 23:26 UTC (permalink / raw)
  To: James Simmons; +Cc: Adrian Bunk, linux-kernel

Hi,

On Fri, 8 Aug 2003, James Simmons wrote:

> > The easier solution is probably to force SERIO to 'y' as well, as the 
> > point of hiding it behind EMBEDDED is to get it compiled into the kernel.
> 
> What I mean is shouldn't build serio by default all the time. USB doesn't 
> need it as well as some other drivers like the Amiga keyboard driver.
> Serio can also be used by more things than I keyboard driver. Maybe I 
> misunderstood?

The problem is CONFIG_KEYBOARD_ATKBD and its dependency to CONFIG_SERIO, 
if CONFIG_KEYBOARD_ATKBD is forced into the kernel, so should 
CONFIG_SERIO.

bye, Roman


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

end of thread, other threads:[~2003-08-08 23:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-08 14:44 Surprising Kconfig depends semantics Adrian Bunk
2003-08-08 15:13 ` Roman Zippel
2003-08-08 16:26   ` James Simmons
2003-08-08 18:30   ` Adrian Bunk
2003-08-08 18:58     ` Roman Zippel
2003-08-08 22:45       ` James Simmons
2003-08-08 23:26         ` Roman Zippel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.