public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
* [PATCH 1/3] cell: fix undefined reference to mmio_nvram_init
@ 2007-12-04  8:34 Ishizaki Kou
  2007-12-04 13:10 ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Ishizaki Kou @ 2007-12-04  8:34 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

This patch fixes the following link error with
CONFIG_PPC_CELL_NATIVE=y and CONFIG_PPC_CELL_BLADE=n:

arch/powerpc/platforms/built-in.o: In function `.cell_setup_arch':
setup.c:(.init.text+0xe80): undefined reference to `.mmio_nvram_init'

Signed-off-by: Kou Ishizaki <Kou.Ishizaki@toshiba•co.jp>
---

Index: linux-powerpc-git/arch/powerpc/platforms/cell/setup.c
===================================================================
--- linux-powerpc-git.orig/arch/powerpc/platforms/cell/setup.c
+++ linux-powerpc-git/arch/powerpc/platforms/cell/setup.c
@@ -179,7 +179,9 @@ static void __init cell_setup_arch(void)
 	conswitchp = &dummy_con;
 #endif
 
+#ifdef CONFIG_MMIO_NVRAM
 	mmio_nvram_init();
+#endif
 }
 
 static int __init cell_probe(void)

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

* Re: [PATCH 1/3] cell: fix undefined reference to mmio_nvram_init
  2007-12-04  8:34 [PATCH 1/3] cell: fix undefined reference to mmio_nvram_init Ishizaki Kou
@ 2007-12-04 13:10 ` Arnd Bergmann
  2007-12-06  6:36   ` Ishizaki Kou
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2007-12-04 13:10 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus

On Tuesday 04 December 2007, Ishizaki Kou wrote:
>=20
> +#ifdef CONFIG_MMIO_NVRAM
> =A0=A0=A0=A0=A0=A0=A0=A0mmio_nvram_init();
> +#endif
> =A0}

The patch is technically correct, but the preferred way of doing this is
to define a conditional inline function in the header, like:

#ifdef CONFIG_MMIO_NVRAM
extern int mmio_nvram_init(void);
#else
static inline int mmio_nvram_init(void)
{
	return 0;
}
#endif

so that the caller does not need to know about it.

	Arnd <><

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

* Re: [PATCH 1/3] cell: fix undefined reference to mmio_nvram_init
  2007-12-04 13:10 ` Arnd Bergmann
@ 2007-12-06  6:36   ` Ishizaki Kou
  0 siblings, 0 replies; 3+ messages in thread
From: Ishizaki Kou @ 2007-12-06  6:36 UTC (permalink / raw)
  To: arnd; +Cc: linuxppc-dev, paulus

Arnd Bergmann <arnd@arndb•de> wrote:
> On Tuesday 04 December 2007, Ishizaki Kou wrote:
> > 
> > +#ifdef CONFIG_MMIO_NVRAM
> > 	mmio_nvram_init();
> > +#endif
> >  }
> 
> The patch is technically correct, but the preferred way of doing this is
> to define a conditional inline function in the header, like:
> 
> #ifdef CONFIG_MMIO_NVRAM
> extern int mmio_nvram_init(void);
> #else
> static inline int mmio_nvram_init(void)
> {
> 	return 0;
> }
> #endif
> 
> so that the caller does not need to know about it.

Okay, I'll change my patch to rewrite include/asm-powerpc/nvram.h.

Best regards,
Kou Ishizaki

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

end of thread, other threads:[~2007-12-06  6:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-04  8:34 [PATCH 1/3] cell: fix undefined reference to mmio_nvram_init Ishizaki Kou
2007-12-04 13:10 ` Arnd Bergmann
2007-12-06  6:36   ` Ishizaki Kou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox