diff mbox

[U-Boot] cmd_sf.c: fix compilation warning

Message ID 1317799406-14698-1-git-send-email-biessmann@corscience.de
State Superseded
Headers show

Commit Message

Andreas Bießmann Oct. 5, 2011, 7:23 a.m. UTC
building ./MAKEALL avr32 complains about

---8<---
Configuring for atngw100 board...
cmd_sf.c: In function 'do_spi_flash':
cmd_sf.c:164: warning: 'skipped' may be used uninitialized in this function
cmd_sf.c:164: note: 'skipped' was declared here
--->8---

This patch fixes it by defining skipped to maximum value.

Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
---
 common/cmd_sf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Andreas Bießmann Oct. 5, 2011, 8:54 a.m. UTC | #1
Ouch,

Am 05.10.2011 09:23, schrieb Andreas Bießmann:
> building ./MAKEALL avr32 complains about
> 
> ---8<---
> Configuring for atngw100 board...
> cmd_sf.c: In function 'do_spi_flash':
> cmd_sf.c:164: warning: 'skipped' may be used uninitialized in this function
> cmd_sf.c:164: note: 'skipped' was declared here
> --->8---
> 
> This patch fixes it by defining skipped to maximum value.

superseeded by several patches.

regards

Andreas Bießmann
diff mbox

Patch

diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index c8c547a..d84dea0 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -161,7 +161,7 @@  static int spi_flash_update(struct spi_flash *flash, u32 offset,
 	char *cmp_buf;
 	const char *end = buf + len;
 	size_t todo;		/* number of bytes to do in this pass */
-	size_t skipped;		/* statistics */
+	size_t skipped = len;		/* statistics */
 
 	cmp_buf = malloc(flash->sector_size);
 	if (cmp_buf) {