linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Jeff Mahoney <jeffm@suse.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] powerpc: Build fix for mpc52xx
Date: Thu, 18 Mar 2010 08:11:41 -0600	[thread overview]
Message-ID: <fa686aa41003180711v7ef387a9t1fed1c1de1352dd3@mail.gmail.com> (raw)
In-Reply-To: <4B980909.7050501@suse.com>

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.

      reply	other threads:[~2010-03-18 14:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-10 21:03 [PATCH] powerpc: Build fix for mpc52xx Jeff Mahoney
2010-03-18 14:11 ` Grant Likely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa686aa41003180711v7ef387a9t1fed1c1de1352dd3@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=jeffm@suse.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).