All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cmd_sf.c: fix compilation warning
@ 2011-10-05  7:23 Andreas Bießmann
  2011-10-05  8:54 ` Andreas Bießmann
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Bießmann @ 2011-10-05  7:23 UTC (permalink / raw)
  To: u-boot

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(-)

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) {
-- 
1.7.6.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-05  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-05  7:23 [U-Boot] [PATCH] cmd_sf.c: fix compilation warning Andreas Bießmann
2011-10-05  8:54 ` Andreas Bießmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.