[U-Boot] [PATCH] spl: mmc: Fix compiler warning

Tom Rini trini at konsulko.com
Sat Dec 5 22:02:56 CET 2015


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 <marex at denx.de>
> Cc: Pantelis Antoniou <panto at antoniou-consulting.com>
> Cc: Tom Rini <trini at konsulko.com>
> Cc: Simon Glass <sjg at chromium.org>

I'm glad we're all grabbing gcc-5.x now.  I am however going to grab
Simon's patch for this shortly.  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151205/cc892d72/attachment.sig>


More information about the U-Boot mailing list