[U-Boot] [PATCH 2/7] spl: mmc: Explicitly init mmc struct
Simon Glass
sjg at chromium.org
Sun Dec 6 17:45:06 CET 2015
Hi Sjoerd,
On 4 December 2015 at 15:27, Sjoerd Simons
<sjoerd.simons at collabora.co.uk> wrote:
> gcc fails to work out that the mmc variable will only ever be used if it
> has been initialized by spl_mmc_get_device_index and throws the
> following error:
>
> 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;
>
> Prevent this by explicitly initializing the variable.
>
> Signed-off-by: Sjoerd Simons <sjoerd.simons at collabora.co.uk>
> ---
See:
http://patchwork.ozlabs.org/patch/551653/
Regards,
Simon
More information about the U-Boot
mailing list