linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Build fix for mpc52xx
@ 2010-03-10 21:03 Jeff Mahoney
  2010-03-18 14:11 ` Grant Likely
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Mahoney @ 2010-03-10 21:03 UTC (permalink / raw)
  To: linuxppc-dev

mpc52xx_gpt_wdt_setup is defined as 0, which causes the following build
failure with gcc 4.5, since it's built with -Werror.

arch/powerpc/platforms/52xx/mpc52xx_gpt.c:761:3: error: statement with no effect

Defining it as do { } while(0) fixes the problem.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
@@ -711,7 +711,7 @@ static int __devinit mpc52xx_gpt_wdt_ini
 	return 0;
 }
 
-#define mpc52xx_gpt_wdt_setup(x, y)		(0)
+#define mpc52xx_gpt_wdt_setup(x, y)		do { } while(0)
 
 #endif	/*  CONFIG_MPC5200_WDT	*/
 
-- 
Jeff Mahoney
SUSE Labs

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

* Re: [PATCH] powerpc: Build fix for mpc52xx
  2010-03-10 21:03 [PATCH] powerpc: Build fix for mpc52xx Jeff Mahoney
@ 2010-03-18 14:11 ` Grant Likely
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2010-03-18 14:11 UTC (permalink / raw)
  To: Jeff Mahoney; +Cc: linuxppc-dev

On Wed, Mar 10, 2010 at 3:03 PM, Jeff Mahoney <jeffm@suse.com> wrote:
> mpc52xx_gpt_wdt_setup is defined as 0, which causes the following build
> failure with gcc 4.5, since it's built with -Werror.
>
> arch/powerpc/platforms/52xx/mpc52xx_gpt.c:761:3: error: statement with no=
 effect
>
> Defining it as do { } while(0) fixes the problem.

Hi Jeff, thanks for the patch.  I've picked it up with a change.
Instead of a #define, I've changed it to an empty static inline.
As akpm likes to say, we should try to program in C, not pre-processor.  :-=
)

diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
b/arch/powerpc/platforms/52x
index 072b948..5d7cc88 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
@@ -711,7 +711,11 @@ static int __devinit mpc52xx_gpt_wdt_init(void)
        return 0;
 }

-#define mpc52xx_gpt_wdt_setup(x, y)            (0)
+static inline int mpc52xx_gpt_wdt_setup(struct mpc52xx_gpt_priv *gpt,
+                                       const u32 *period)
+{
+       return 0;
+}

 #endif /*  CONFIG_MPC5200_WDT  */

>
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>
> ---
> =A0arch/powerpc/platforms/52xx/mpc52xx_gpt.c | =A0 =A02 +-
> =A01 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
> +++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
> @@ -711,7 +711,7 @@ static int __devinit mpc52xx_gpt_wdt_ini
> =A0 =A0 =A0 =A0return 0;
> =A0}
>
> -#define mpc52xx_gpt_wdt_setup(x, y) =A0 =A0 =A0 =A0 =A0 =A0(0)
> +#define mpc52xx_gpt_wdt_setup(x, y) =A0 =A0 =A0 =A0 =A0 =A0do { } while(=
0)
>
> =A0#endif /* =A0CONFIG_MPC5200_WDT =A0*/
>
> --
> Jeff Mahoney
> SUSE Labs
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

end of thread, other threads:[~2010-03-18 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-10 21:03 [PATCH] powerpc: Build fix for mpc52xx Jeff Mahoney
2010-03-18 14:11 ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).