Skip to contentSkip to conversation

Fixed statement without effect by using a correct empty instruction

PATCH In review Marcus Meissner 2 participants 3 messages Feb 24, 2010

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

PATCH 1/1 Fixed statement without effect by using a correct empty instruction

This fixes this build failure:
cc1: warnings being treated as errors /usr/src/packages/BUILD/kernel-default-2.6.33/linux-2.6.32/arch/powerpc/platforms/52xx/mpc52xx_gpt.c: In function 'mpc52xx_gpt_probe':
/usr/src/packages/BUILD/kernel-default-2.6.33/linux-2.6.32/arch/powerpc/platforms/52xx/mpc52xx_gpt.c:761:3: error: statement with no effect

---
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/platforms/52xx/mpc52xx_gpt.c +1 -1
index 6f8ebe1..88231d8 100644
@@ -711,7 +711,7 @@ static int __devinit mpc52xx_gpt_wdt_init(void)
 	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 · 1 line
1.6.6.1
#1 lore raw
Quoted 3 lines · Marcus Meissner

This fixes this build failure:
cc1: warnings being treated as errors /usr/src/packages/BUILD/kernel-default-2.6.33/linux-2.6.32/arch/powerpc/p=

latforms/52xx/mpc52xx_gpt.c: In function 'mpc52xx_gpt_probe':

Quoted 1 line

/usr/src/packages/BUILD/kernel-default-2.6.33/linux-2.6.32/arch/powerpc/p=

latforms/52xx/mpc52xx_gpt.c:761:3: error: statement with no effect

Quoted 2 lines

Hi Marcus, thanks for the patch. One comment below...

arch/powerpc/pla=

Quoted 5 lines

---
=A0arch/powerpc/platforms/52xx/mpc52xx_gpt.c | =A0 =A02 +- =A01 files changed, 1 insertions(+), 1 deletions(-)

arch/powerpc/pla= renamed from arch/powerpc/platforms/52xx/mpc52xx_gpt.c +0 -0

tforms/52xx/mpc52xx_gpt.c

arch/powerpc/platforms/52xx/mpc52xx_gpt.c static int __devinit mpc52xx_gpt_wdt_init(void) · line 714

Quoted 9 lines

index 6f8ebe1..88231d8 100644

arch/powerpc/platforms/52xx/mpc52xx_gpt.c +1 -1
@@ -711,7 +711,7 @@ static int __devinit mpc52xx_gpt_wdt_init(void)
 =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)

As Andrew likes to say, we should be programming in C instead of preprocess= or.

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

#2 lore raw
Quoted 29 lines · Grant Likely
Quoted 6 lines · Marcus Meissner

This fixes this build failure:
cc1: warnings being treated as errors /usr/src/packages/BUILD/kernel-default-2.6.33/linux-2.6.32/arch/powerpc/platforms/52xx/mpc52xx_gpt.c: In function 'mpc52xx_gpt_probe':
/usr/src/packages/BUILD/kernel-default-2.6.33/linux-2.6.32/arch/powerpc/platforms/52xx/mpc52xx_gpt.c:761:3: error: statement with no effect

Hi Marcus, thanks for the patch. One comment below...

Quoted 9 lines

---
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/platforms/52xx/mpc52xx_gpt.c +0 -0
index 6f8ebe1..88231d8 100644

arch/powerpc/platforms/52xx/mpc52xx_gpt.c static int __devinit mpc52xx_gpt_wdt_init(void) · line 714

Quoted 5 lines
arch/powerpc/platforms/52xx/mpc52xx_gpt.c +1 -1
@@ -711,7 +711,7 @@ static int __devinit mpc52xx_gpt_wdt_init(void)
        return 0;
  }
 
-#define mpc52xx_gpt_wdt_setup(x, y)            (0)
+#define mpc52xx_gpt_wdt_setup(x, y)            do { } while (0)

As Andrew likes to say, we should be programming in C instead of preprocessor.

(quoted diff) +1 -1
-#define mpc52xx_gpt_wdt_setup(x, y)            (0)
+static inline void mpc52xx_gpt_wdt_setup(struct mpc52xx_gpt_priv
Quoted 1 line

*gpt, const u32 *period) { }

Sounds good to me too. :)

Ciao, Marcus