From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sun, 6 Dec 2015 08:45:06 -0800 Subject: [U-Boot] [PATCH 2/7] spl: mmc: Explicitly init mmc struct In-Reply-To: <1449268061-805-3-git-send-email-sjoerd.simons@collabora.co.uk> References: <1449268061-805-1-git-send-email-sjoerd.simons@collabora.co.uk> <1449268061-805-3-git-send-email-sjoerd.simons@collabora.co.uk> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Sjoerd, On 4 December 2015 at 15:27, Sjoerd Simons 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 > --- See: http://patchwork.ozlabs.org/patch/551653/ Regards, Simon