Skip to contentSkip to conversation

Surprising Kconfig depends semantics

DISCUSSION Adrian Bunk 3 participants 7 messages Aug 8, 2003

lore
Share & tools
lore
#0 lore raw

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

Signature · 4 lines
       "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
#1 lore raw

Hi,

Quoted 6 lines · Adrian Bunk

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)

Quoted 7 lines

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

#2 lore raw
Quoted 8 lines
Quoted 7 lines

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
Quoted 5 lines

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/

#3 lore raw
In reply to Roman Zippel
Quoted 1 line · Roman Zippel

Hi,

Hi Roman,

Quoted 9 lines · Adrian Bunk
Quoted 7 lines

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
Quoted 5 lines

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
Quoted 9 lines
Quoted 7 lines

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

Quoted 1 line

bye, Roman

cu
Adrian

Signature · 4 lines
       "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
#4 lore raw

Hi,

Quoted 10 lines · Adrian Bunk
Quoted 5 lines

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.

Quoted 8 lines

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

#5 lore raw
Quoted 7 lines
Quoted 4 lines

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.

....

Quoted 2 lines

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?

#6 lore raw

Hi,

Quoted 7 lines · James Simmons
Quoted 2 lines

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