Skip to contentSkip to conversation

request_queue_t depends on CONFIG_BLOCK

DISCUSSION Olaf Hering 3 participants 6 messages Mar 22, 2007 – Mar 23, 2007 libata

lore
Share & tools
lore
#0 lore raw

How can this compile error be fixed properly? request_queue_t is inside CONFIG_BLOCK, ide_drive_s (and likely others) use it unconditionally.

CC arch/powerpc/kernel/setup_64.o
In file included from linux-2.6.21-rc4/arch/powerpc/kernel/setup_64.c:23:
linux-2.6.21-rc4/include/linux/ide.h:556: error: expected specifier-qualifier-list before 'request_queue_t' linux-2.6.21-rc4/include/linux/ide.h:695: warning: 'struct request' declared inside parameter list linux-2.6.21-rc4/include/linux/ide.h:695: warning: its scope is only this definition or declaration, which is probably not what you want linux-2.6.21-rc4/include/linux/ide.h:823: warning: 'struct request' declared inside parameter list linux-2.6.21-rc4/include/linux/ide.h:856: error: field 'wrq' has incomplete type linux-2.6.21-rc4/include/linux/ide.h:1199: error: expected ')' before '*' token
make[2]: *** [arch/powerpc/kernel/setup_64.o] Error 1
CC arch/powerpc/kernel/setup-common.o
In file included from linux-2.6.21-rc4/arch/powerpc/kernel/setup-common.c:24:
linux-2.6.21-rc4/include/linux/ide.h:556: error: expected specifier-qualifier-list before 'request_queue_t' linux-2.6.21-rc4/include/linux/ide.h:695: warning: 'struct request' declared inside parameter list linux-2.6.21-rc4/include/linux/ide.h:695: warning: its scope is only this definition or declaration, which is probably not what you want linux-2.6.21-rc4/include/linux/ide.h:823: warning: 'struct request' declared inside parameter list linux-2.6.21-rc4/include/linux/ide.h:856: error: field 'wrq' has incomplete type linux-2.6.21-rc4/include/linux/ide.h:1199: error: expected ')' before '*' token
make[2]: *** [arch/powerpc/kernel/setup-common.o] Error 1
make[2]: Target `__build' not remade because of errors.
make[1]: *** [arch/powerpc/kernel] Error 2

#1 lore raw
Quoted 7 lines · Olaf Hering

How can this compile error be fixed properly? request_queue_t is inside CONFIG_BLOCK, ide_drive_s (and likely others) use it unconditionally.

CC arch/powerpc/kernel/setup_64.o
In file included from linux-2.6.21-rc4/arch/powerpc/kernel/setup_64.c:23:

start looking for the problem here. Why does you arch code include ide.h?

#2 lore raw
Quoted 10 lines · Christoph Hellwig
Quoted 7 lines · Olaf Hering

How can this compile error be fixed properly? request_queue_t is inside CONFIG_BLOCK, ide_drive_s (and likely others) use it unconditionally.

CC arch/powerpc/kernel/setup_64.o
In file included from linux-2.6.21-rc4/arch/powerpc/kernel/setup_64.c:23:

start looking for the problem here. Why does you arch code include ide.h?

Because it is needed in a few places.
Better hide everything in ide.h inside #ifdef CONFIG_IDE

#3 lore raw

Hi,

Quoted 8 lines · Olaf Hering
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · Olaf Hering

How can this compile error be fixed properly? request_queue_t is inside CONFIG_BLOCK, ide_drive_s (and likely others) use it unconditionally.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

CC arch/powerpc/kernel/setup_64.o
In file included from linux-2.6.21-rc4/arch/powerpc/kernel/setup_64.c:23:

start looking for the problem here. Why does you arch code include ide.h?

Because it is needed in a few places.

Is there really any PPC64 specific code which needs <linux/ide.h> (ppc_ide_md is used only by PPC32)?

Quoted 1 line

Better hide everything in ide.h inside #ifdef CONFIG_IDE

<linux/ide.h> is _stricly_ for IDE subsystem, please fix PPC64 code instead

Thanks,
Bart

#4 lore raw
Quoted 4 lines · Bartlomiej Zolnierkiewicz
Quoted 1 line

Because it is needed in a few places.

Is there really any PPC64 specific code which needs <linux/ide.h> (ppc_ide_md is used only by PPC32)?

This is about CONFIG_BLOCK=n, not about arch/... Is all non-driver code which has to poke into ide code supposed to put an #ifdef CONFIG_IDE around #include <linux/ide.h>?

#5 lore raw
Quoted 6 lines · Olaf Hering
Quoted 4 lines · Bartlomiej Zolnierkiewicz
Quoted 1 line

Because it is needed in a few places.

Is there really any PPC64 specific code which needs <linux/ide.h> (ppc_ide_md is used only by PPC32)?

I suspect that the answer to my question is "not really", if so then shouldn't the problem that you've encountered be fixed with a one-line patch which removes <linux/ide.h> include from arch/powerpc/kernel/setup_64.c?

Please try it.

Quoted 3 lines

This is about CONFIG_BLOCK=n, not about arch/... Is all non-driver code which has to poke into ide code supposed to put an #ifdef CONFIG_IDE around #include <linux/ide.h>?

Such code is _broken_ (as you've just found out) by _implicitly_ depending on CONFIG_IDE specific data structures and functions. Please note that <linux/ide.h> is CONFIG_IDE specific and CONFIG_IDE depends on CONFIG_BLOCK=y so <linux/ide.h> should _not_ be included et all for CONFIG_BLOCK=n case...

PS IDE subsystem has allowed per arch/platform host drivers for years and if somebody needs help in fixing the existing arch/... (ab)users of <linux/ide.h> I'll be glad to provide it.

Thanks,
Bart