Skip to contentSkip to conversation

powerpc: Build fix for mpc52xx

PATCH In review Jeff Mahoney 2 participants 2 messages Mar 10, 2010 – Mar 18, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Build fix for mpc52xx

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.

---
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/52xx/mpc52xx_gpt.c +1 -1
@@ -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	*/
 
Signature · 2 lines
Jeff Mahoney
SUSE Labs
#1 lore raw
Quoted 4 lines · Jeff Mahoney

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

Quoted 2 lines

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. :-= )

(quoted diff) +0 -0

b/arch/powerpc/platforms/52x
index 072b948..5d7cc88 100644

arch/powerpc/platforms/52xx/mpc52xx_gpt.c +5 -1
@@ -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  */
 
Quoted 9 lines

---
=A0arch/powerpc/platforms/52xx/mpc52xx_gpt.c | =A0 =A02 +- =A01 file changed, 1 insertion(+), 1 deletion(-)

arch/powerpc/platforms/52xx/mpc52xx_gpt.c static int __devinit mpc52xx_gpt_wdt_ini · line 714

Quoted 5 lines
arch/powerpc/platforms/52xx/mpc52xx_gpt.c +1 -1
@@ -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)

Quoted 11 lines

=A0#endif /* =A0CONFIG_MPC5200_WDT =A0*/

--
Jeff Mahoney
SUSE Labs
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

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