Fix build errors when BLOCK=n
PATCH v2 1/1 Fix build errors when BLOCK=n
These are the symptom error messages:
CC arch/powerpc/kernel/setup_32.o
In file included from include/linux/blkdev.h:17,
from include/linux/ide.h:13,
from arch/powerpc/kernel/setup_32.c:13:include/linux/bsg.h:67: warning: 'struct request_queue' declared inside parameter list include/linux/bsg.h:67: warning: its scope is only this definition or declaration, which is probably not what you want include/linux/bsg.h:71: warning: 'struct request_queue' declared inside parameter list
In file included from arch/powerpc/kernel/setup_32.c:13:include/linux/ide.h:857: error: field 'wrq' has incomplete type
CC arch/powerpc/kernel/ppc_ksyms.o
In file included from include/linux/blkdev.h:17,
from include/linux/ide.h:13,
from arch/powerpc/kernel/ppc_ksyms.c:15:include/linux/bsg.h:67: warning: 'struct request_queue' declared inside parameter list include/linux/bsg.h:67: warning: its scope is only this definition or declaration, which is probably not what you want include/linux/bsg.h:71: warning: 'struct request_queue' declared inside parameter list
In file included from arch/powerpc/kernel/ppc_ksyms.c:15:include/linux/ide.h:857: error: field 'wrq' has incomplete type
The fix tries to use the smallest scope CONFIG_* symbols that will fix the build problem. In this case <linux/ide.h> needs to be included only if IDE=y or IDE=m were selected. Also, ppc_ide_md is needed only if BLK_DEV_IDE=y or BLK_DEV_IDE=m
Moved the EXPORT_SYMBOL(ppc_ide_md) from ppc_ksysms.c next to its declaration in setup_32.c
---
I tested that the code builds with this patch in various combinations of configuration options: all the combinations involving BLOCK, IDE and BLK_DEV_IDE
A patch for the warnings above has been already commited here: http://git.kernel.org/?p=linux/kernel/git/jejb/scsi-misc-2.6.git;a=commitdiff;h=49892223f7d3a2333ef9e6cbdd526676e1fc517a
This a patch against Paul's tree (75cdff9242c4e048cb830d359920719d29b9ee7c)
powerpc> scripts/checkpatch.pl 0001-POWERPC-Fix-build-errors-when-BLOCK-n.patch Your patch has no obvious style problems and is ready for submission.
arch/powerpc/kernel/ppc_ksyms.c | 7 +++---- arch/powerpc/kernel/setup_32.c | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-)
arch/powerpc/kernel/ppc_ksyms.c +3 -4
@@ -12,12 +12,15 @@#include <linux/irq.h> #include <linux/pci.h> #include <linux/delay.h> +#if defined(CONFIG_IDE ) || defined(CONFIG_IDE_MODULE )#include <linux/ide.h> +#endif #include <linux/bitops.h> #include <asm/page.h> #include <asm/semaphore.h> #include <asm/processor.h> +#include <asm/cacheflush.h> #include <asm/uaccess.h> #include <asm/io.h> #include <asm/atomic.h>
@@ -95,10 +98,6 @@ EXPORT_SYMBOL(__strnlen_user);EXPORT_SYMBOL (copy_4K_page);#endif -#if defined(CONFIG_PPC32 ) && (defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE )) -EXPORT_SYMBOL (ppc_ide_md); -#endif -#if defined(CONFIG_PCI ) && defined(CONFIG_PPC32 )EXPORT_SYMBOL (isa_io_base);EXPORT_SYMBOL (isa_mem_base);
arch/powerpc/kernel/setup_32.c +5 -0
@@ -10,7 +10,9 @@#include <linux/reboot.h> #include <linux/delay.h> #include <linux/initrd.h> +#if defined(CONFIG_IDE ) || defined(CONFIG_IDE_MODULE )#include <linux/ide.h> +#endif #include <linux/tty.h> #include <linux/bootmem.h> #include <linux/seq_file.h>
@@ -49,7 +51,10 @@extern void bootx_init (unsigned long r4,unsigned long phys); +#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE )struct ide_machdep_calls ppc_ide_md; +EXPORT_SYMBOL (ppc_ide_md); +#endif int boot_cpuid;EXPORT_SYMBOL_GPL (boot_cpuid);
Signature · 1 line
1.5.3.GIT
Quoted 27 lines · Emil Medve
These are the symptom error messages:
CC
arch/powerpc/kernel/setup_32.o
In file included frominclude/linux/blkdev.h:17,from include/linux/ide.h:13, from arch/powerpc/kernel/setup_32.c:13:
include/linux/bsg.h:67: warning: 'structrequest_queue' declared inside parameter listinclude/linux/bsg.h:67: warning: its scope is only this definition or declaration, which is probably not what you wantinclude/linux/bsg.h:71: warning: 'structrequest_queue' declared inside parameter list
In file included fromarch/powerpc/kernel/setup_32.c:13:include/linux/ide.h:857: error: field 'wrq' has incomplete typeCC
arch/powerpc/kernel/ppc_ksyms.o
In file included frominclude/linux/blkdev.h:17,
frominclude/linux/ide.h:13,
fromarch/powerpc/kernel/ppc_ksyms.c:15:include/linux/bsg.h:67: warning: 'structrequest_queue' declared inside parameter listinclude/linux/bsg.h:67: warning: its scope is only this definition or declaration, which is probably not what you wantinclude/linux/bsg.h:71: warning: 'structrequest_queue' declared inside parameter list
In file included fromarch/powerpc/kernel/ppc_ksyms.c:15:include/linux/ide.h:857: error: field 'wrq' has incomplete typeThe fix tries to use the smallest scope CONFIG_* symbols that will fix the build problem. In this case <
linux/ide.h> needs to be included only if IDE=y or IDE=m were selected. Also,ppc_ide_mdis needed only if BLK_DEV_IDE=y or BLK_DEV_IDE=m
Quoted 4 lines
Moved the
EXPORT_SYMBOL(ppc_ide_md)fromppc_ksysms.cnext to its declaration insetup_32.cSigned-off-by Emil Medve <[email protected]>
looks OK for me
arch/powerpc/kernel/ppc_ksyms.c line 17
Quoted 9 lines · Emil Medve
arch/powerpc/kernel/ppc_ksyms.c +2
-0@@ -12,12 +12,15 @@#include <linux/irq.h> #include <linux/pci.h> #include <linux/delay.h> +#if defined(CONFIG_IDE ) || defined(CONFIG_IDE_MODULE )#include <linux/ide.h> +#endif
Why are we still including linux/ide.h at all here?
arch/powerpc/kernel/ppc_ksyms.c line 23
Quoted 6 lines
arch/powerpc/kernel/ppc_ksyms.c +1
-0#include <linux/bitops.h> #include <asm/page.h> #include <asm/semaphore.h> #include <asm/processor.h> +#include <asm/cacheflush.h>
What's the point of adding this?
Paul.