* [PATCH] [POWERPC] Fix build errors when BLOCK=n
@ 2007-09-17 21:58 Emil Medve
2007-09-17 22:34 ` David Howells
2007-09-19 4:49 ` Paul Mackerras
0 siblings, 2 replies; 4+ messages in thread
From: Emil Medve @ 2007-09-17 21:58 UTC (permalink / raw)
To: paulus, kumar.gala, linuxppc-dev, bzolnier, linux-ide; +Cc: Emil Medve
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
Signed-off-by: Emil Medve <Emilian.Medve@Freescale•com>
---
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 (01f1c735f57548e6b862e815cc845e452405643d)
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 | 5 ++++-
arch/powerpc/kernel/setup_32.c | 4 ++++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 430c502..ba3a928 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -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,7 +98,7 @@ 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))
+#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
EXPORT_SYMBOL(ppc_ide_md);
#endif
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index a288a5f..3d46a30 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -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,9 @@
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;
+#endif
int boot_cpuid;
EXPORT_SYMBOL_GPL(boot_cpuid);
--
1.5.3.GIT
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] [POWERPC] Fix build errors when BLOCK=n
2007-09-17 21:58 [PATCH] [POWERPC] Fix build errors when BLOCK=n Emil Medve
@ 2007-09-17 22:34 ` David Howells
2007-09-17 22:43 ` Medve Emilian-EMMEDVE1
2007-09-19 4:49 ` Paul Mackerras
1 sibling, 1 reply; 4+ messages in thread
From: David Howells @ 2007-09-17 22:34 UTC (permalink / raw)
To: Emil Medve; +Cc: bzolnier, linux-ide, kumar.gala, linuxppc-dev, paulus
Try the attached.
David
---
[PATCH] VFS: Make BSG declarations dependent on CONFIG_BLOCK
From: David Howells <dhowells@redhat•com>
Make BSG function declarations dependent on CONFIG_BLOCK as they are not
compilable if the block layer is compiled out.
Signed-off-by: David Howells <dhowells@redhat•com>
---
include/linux/bsg.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index 60e377b..28f5d44 100644
--- a/include/linux/bsg.h
+++ b/include/linux/bsg.h
@@ -52,6 +52,7 @@ struct sg_io_v4 {
};
#ifdef __KERNEL__
+#ifdef CONFIG_BLOCK
#if defined(CONFIG_BLK_DEV_BSG)
struct bsg_class_device {
@@ -73,6 +74,7 @@ static inline void bsg_unregister_queue(struct request_queue *rq)
}
#endif
+#endif /* CONFIG_BLOCK */
#endif /* __KERNEL__ */
#endif
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH] [POWERPC] Fix build errors when BLOCK=n
2007-09-17 22:34 ` David Howells
@ 2007-09-17 22:43 ` Medve Emilian-EMMEDVE1
0 siblings, 0 replies; 4+ messages in thread
From: Medve Emilian-EMMEDVE1 @ 2007-09-17 22:43 UTC (permalink / raw)
To: dhowells; +Cc: linuxppc-dev, Gala Kumar-B11780, paulus, bzolnier, linux-ide
Hi David,
I've seen you patch earlier, but I'm not trying to solve the BSG related
problem/warnings. That's why I put a reference to an already existing
commit addressing the BSG/bsg.h warnings. I'm trying to address a
slightly different problem in the PowerPC code only.
Cheers,
Emil.
> -----Original Message-----
> From: dhowells@redhat•com [mailto:dhowells@redhat•com]=20
> Sent: Monday, September 17, 2007 5:35 PM
> To: Medve Emilian-EMMEDVE1
> Cc: dhowells@redhat•com; paulus@samba•org; Gala Kumar-B11780;=20
> linuxppc-dev@ozlabs•org; bzolnier@gmail•com; linux-ide@vger•kernel.org
> Subject: Re: [PATCH] [POWERPC] Fix build errors when BLOCK=3Dn
>=20
>=20
> Try the attached.
>=20
> David
> ---
> [PATCH] VFS: Make BSG declarations dependent on CONFIG_BLOCK
>=20
> From: David Howells <dhowells@redhat•com>
>=20
> Make BSG function declarations dependent on CONFIG_BLOCK as=20
> they are not
> compilable if the block layer is compiled out.
>=20
> Signed-off-by: David Howells <dhowells@redhat•com>
> ---
>=20
> include/linux/bsg.h | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>=20
> diff --git a/include/linux/bsg.h b/include/linux/bsg.h
> index 60e377b..28f5d44 100644
> --- a/include/linux/bsg.h
> +++ b/include/linux/bsg.h
> @@ -52,6 +52,7 @@ struct sg_io_v4 {
> };
> =20
> #ifdef __KERNEL__
> +#ifdef CONFIG_BLOCK
> =20
> #if defined(CONFIG_BLK_DEV_BSG)
> struct bsg_class_device {
> @@ -73,6 +74,7 @@ static inline void=20
> bsg_unregister_queue(struct request_queue *rq)
> }
> #endif
> =20
> +#endif /* CONFIG_BLOCK */
> #endif /* __KERNEL__ */
> =20
> #endif
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] [POWERPC] Fix build errors when BLOCK=n
2007-09-17 21:58 [PATCH] [POWERPC] Fix build errors when BLOCK=n Emil Medve
2007-09-17 22:34 ` David Howells
@ 2007-09-19 4:49 ` Paul Mackerras
1 sibling, 0 replies; 4+ messages in thread
From: Paul Mackerras @ 2007-09-19 4:49 UTC (permalink / raw)
To: Emil Medve; +Cc: linuxppc-dev, kumar.gala, bzolnier, linux-ide
Emil Medve writes:
> 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
It would be nicer to remove the ppc_ide_md stuff from ppc_ksyms.c
altogether and just put the EXPORT_SYMBOL in setup_32.c.
Paul.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-09-19 4:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-17 21:58 [PATCH] [POWERPC] Fix build errors when BLOCK=n Emil Medve
2007-09-17 22:34 ` David Howells
2007-09-17 22:43 ` Medve Emilian-EMMEDVE1
2007-09-19 4:49 ` Paul Mackerras
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox