From patchwork Thu Mar 18 14:11:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 48038 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id E1FE6B7F71 for ; Fri, 19 Mar 2010 01:12:12 +1100 (EST) Received: by ozlabs.org (Postfix) id 3CB30B7D0D; Fri, 19 Mar 2010 01:12:04 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-gy0-f170.google.com (mail-gy0-f170.google.com [209.85.160.170]) by ozlabs.org (Postfix) with ESMTP id 7E19FB7D0C for ; Fri, 19 Mar 2010 01:12:02 +1100 (EST) Received: by gyf1 with SMTP id 1so1067237gyf.15 for ; Thu, 18 Mar 2010 07:12:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.117.10 with SMTP id p10mr1909537ybc.121.1268921521166; Thu, 18 Mar 2010 07:12:01 -0700 (PDT) In-Reply-To: <4B980909.7050501@suse.com> References: <4B980909.7050501@suse.com> From: Grant Likely Date: Thu, 18 Mar 2010 08:11:41 -0600 X-Google-Sender-Auth: bea19ddb9da2bb92 Message-ID: Subject: Re: [PATCH] powerpc: Build fix for mpc52xx To: Jeff Mahoney Cc: linuxppc-dev@ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org On Wed, Mar 10, 2010 at 3:03 PM, Jeff Mahoney 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. :-) > > Signed-off-by: Jeff Mahoney > --- >  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 > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/linuxppc-dev > 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 */