From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sat, 5 Dec 2015 22:04:16 +0100 Subject: [U-Boot] [PATCH] spl: mmc: Fix compiler warning In-Reply-To: <20151205210256.GA9551@bill-the-cat> References: <1449348155-18390-1-git-send-email-marex@denx.de> <20151205210256.GA9551@bill-the-cat> Message-ID: <201512052204.16824.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Saturday, December 05, 2015 at 10:02:56 PM, Tom Rini wrote: > On Sat, Dec 05, 2015 at 09:42:35PM +0100, Marek Vasut wrote: > > Fix the following warning: > > common/spl/spl_mmc.c: In function 'spl_mmc_load_image': > > common/spl/spl_mmc.c:31:24: warning: 'mmc' may be used uninitialized in > > this function [-Wmaybe-uninitialized] > > > > count = mmc->block_dev.block_read(0, sector, 1, header); > > > > ^ > > > > common/spl/spl_mmc.c:251:14: note: 'mmc' was declared here > > > > struct mmc *mmc; > > > > ^ > > > > The fix is as simple as initializing the struct mmc *mmc to NULL, > > so the subsequent functions can check if the variable is set or > > not. > > > > Signed-off-by: Marek Vasut > > Cc: Pantelis Antoniou > > Cc: Tom Rini > > Cc: Simon Glass > > I'm glad we're all grabbing gcc-5.x now. I am however going to grab > Simon's patch for this shortly. Thanks! This popped up with gcc 4.9 though ;-) Thanks anyway. Best regards, Marek Vasut