From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932706AbcBBOsL (ORCPT ); Tue, 2 Feb 2016 09:48:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:43039 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932478AbcBBOsI (ORCPT ); Tue, 2 Feb 2016 09:48:08 -0500 Date: Tue, 2 Feb 2016 15:48:03 +0100 From: Johannes Thumshirn To: Guenter Roeck Cc: Borislav Petkov , Sudip Mukherjee , Johannes Thumshirn , Doug Thompson , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org Subject: Re: [PATCH] EDAC, mpc85xx: fix build warning Message-ID: <20160202144803.GQ27969@c203.arch.suse.de> References: <1454400021-17583-1-git-send-email-sudipm.mukherjee@gmail.com> <20160202111545.GC3778@pd.tnic> <20160202143801.GA6995@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160202143801.GA6995@roeck-us.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 02, 2016 at 06:38:01AM -0800, Guenter Roeck wrote: > On Tue, Feb 02, 2016 at 12:15:45PM +0100, Borislav Petkov wrote: > > On Tue, Feb 02, 2016 at 01:30:21PM +0530, Sudip Mukherjee wrote: > > > We were getting build warning about: > > > drivers/edac/mpc85xx_edac.c:1247:6: warning: unused variable 'pvr' > > > > > > pvr is only used if CONFIG_FSL_SOC_BOOKE was defined. Declare the > > > variable as a local variable inside the #ifdef block. > > > > What's wrong with doing the simpler thing: > > > > --- > > diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c > > index b7139c160baf..f756b6215228 100644 > > --- a/drivers/edac/mpc85xx_edac.c > > +++ b/drivers/edac/mpc85xx_edac.c > > @@ -1244,7 +1244,6 @@ static struct platform_driver * const drivers[] = { > > static int __init mpc85xx_mc_init(void) > > { > > int res = 0; > > - u32 pvr = 0; > > > Or with just adding __maybe_unused here. I'd favour this one as well. Just my 2c. byte, Johannes -- Johannes Thumshirn Storage jthumshirn@suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850