linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fixed statement without effect by using a correct empty instruction
@ 2010-02-24  8:51 Marcus Meissner
  2010-02-24 13:40 ` Grant Likely
  0 siblings, 1 reply; 3+ messages in thread
From: Marcus Meissner @ 2010-02-24  8:51 UTC (permalink / raw)
  To: linuxppc-dev, albrecht.dress, grant.likely

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

Signed-off-by: Marcus Meissner <meissner@suse.de>
---
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
index 6f8ebe1..88231d8 100644
--- 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_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	*/
 
-- 
1.6.6.1

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

* Re: [PATCH] Fixed statement without effect by using a correct empty instruction
  2010-02-24  8:51 [PATCH] Fixed statement without effect by using a correct empty instruction Marcus Meissner
@ 2010-02-24 13:40 ` Grant Likely
  2010-02-24 13:43   ` Marcus Meissner
  0 siblings, 1 reply; 3+ messages in thread
From: Grant Likely @ 2010-02-24 13:40 UTC (permalink / raw)
  To: Marcus Meissner; +Cc: linuxppc-dev, albrecht.dress

On Wed, Feb 24, 2010 at 1:51 AM, Marcus Meissner <meissner@suse.de> wrote:
> 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':
> /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
>
> Signed-off-by: Marcus Meissner <meissner@suse.de>

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

> ---
> =A0arch/powerpc/platforms/52xx/mpc52xx_gpt.c | =A0 =A02 +-
> =A01 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/pla=
tforms/52xx/mpc52xx_gpt.c
> index 6f8ebe1..88231d8 100644
> --- 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_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) { }

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

* Re: [PATCH] Fixed statement without effect by using a correct empty instruction
  2010-02-24 13:40 ` Grant Likely
@ 2010-02-24 13:43   ` Marcus Meissner
  0 siblings, 0 replies; 3+ messages in thread
From: Marcus Meissner @ 2010-02-24 13:43 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, albrecht.dress

On Wed, Feb 24, 2010 at 06:40:37AM -0700, Grant Likely wrote:
> On Wed, Feb 24, 2010 at 1:51 AM, Marcus Meissner <meissner@suse.de> wrote:
> > 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
> >
> > Signed-off-by: Marcus Meissner <meissner@suse.de>
> 
> Hi Marcus, thanks for the patch.  One comment below...
> 
> > ---
> >  arch/powerpc/platforms/52xx/mpc52xx_gpt.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
> > index 6f8ebe1..88231d8 100644
> > --- 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_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.
> 
> -#define mpc52xx_gpt_wdt_setup(x, y)            (0)
> +static inline void mpc52xx_gpt_wdt_setup(struct mpc52xx_gpt_priv
> *gpt, const u32 *period) { }

Sounds good to me too. :)

Ciao, Marcus

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

end of thread, other threads:[~2010-02-24 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-24  8:51 [PATCH] Fixed statement without effect by using a correct empty instruction Marcus Meissner
2010-02-24 13:40 ` Grant Likely
2010-02-24 13:43   ` Marcus Meissner

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