diff mbox

[U-Boot] driver/mmc: fix compile warnings

Message ID 1396260123-2396-1-git-send-email-prabhakar@freescale.com
State Accepted
Delegated to: York Sun
Headers show

Commit Message

Prabhakar Kushwaha March 31, 2014, 10:02 a.m. UTC
Fix following compile warnings
fsl_esdhc_spl.c: In function 'mmc_boot':
fsl_esdhc_spl.c:35:10: warning: unused variable 'byte_num' [-Wunused-variable]
fsl_esdhc_spl.c:35:7: warning: unused variable 'i' [-Wunused-variable]
fsl_esdhc_spl.c:34:8: warning: unused variable 'val' [-Wunused-variable]
fsl_esdhc_spl.c:33:6: warning: unused variable 'blklen' [-Wunused-variable]
fsl_esdhc_spl.c:105:7: warning: 'tmp_buf' may be used uninitialized in this
function [-Wuninitialized]

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
 drivers/mmc/fsl_esdhc_spl.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

York Sun April 23, 2014, 10 p.m. UTC | #1
On 03/31/2014 03:02 AM, Prabhakar Kushwaha wrote:
> Fix following compile warnings
> fsl_esdhc_spl.c: In function 'mmc_boot':
> fsl_esdhc_spl.c:35:10: warning: unused variable 'byte_num' [-Wunused-variable]
> fsl_esdhc_spl.c:35:7: warning: unused variable 'i' [-Wunused-variable]
> fsl_esdhc_spl.c:34:8: warning: unused variable 'val' [-Wunused-variable]
> fsl_esdhc_spl.c:33:6: warning: unused variable 'blklen' [-Wunused-variable]
> fsl_esdhc_spl.c:105:7: warning: 'tmp_buf' may be used uninitialized in this
> function [-Wuninitialized]
> 
> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> ---

Applied to u-boot-mpc85xx/master, thanks.

York
diff mbox

Patch

diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c
index 8fc263f..e0bbf21 100644
--- a/drivers/mmc/fsl_esdhc_spl.c
+++ b/drivers/mmc/fsl_esdhc_spl.c
@@ -29,10 +29,12 @@  void __noreturn mmc_boot(void)
 {
 	__attribute__((noreturn)) void (*uboot)(void);
 	uint blk_start, blk_cnt, err;
-	u32 blklen;
+#ifndef CONFIG_FSL_CORENET
 	uchar *tmp_buf;
+	u32 blklen;
 	uchar val;
 	uint i, byte_num;
+#endif
 	u32 offset, code_len;
 	struct mmc *mmc;
 
@@ -102,7 +104,9 @@  void __noreturn mmc_boot(void)
 					(uchar *)CONFIG_SYS_MMC_U_BOOT_DST);
 	if (err != blk_cnt) {
 		puts("spl: mmc read failed!!\n");
+#ifndef CONFIG_FSL_CORENET
 		free(tmp_buf);
+#endif
 		hang();
 	}