[U-Boot] [PATCH 2/2] fsl: sys_eeprom: Fix 'may be used uninitialized' warning

Anton Vorontsov avorontsov at ru.mvista.com
Tue Sep 1 18:59:02 CEST 2009


The warning is bogus, so silence it with uninitialized_var().

Signed-off-by: Anton Vorontsov <avorontsov at ru.mvista.com>
---
 board/freescale/common/sys_eeprom.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c
index c0fff68..a765b39 100644
--- a/board/freescale/common/sys_eeprom.c
+++ b/board/freescale/common/sys_eeprom.c
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <compiler.h>
 #include <command.h>
 #include <i2c.h>
 #include <linux/ctype.h>
@@ -204,7 +205,8 @@ static void update_crc(void)
  */
 static int prog_eeprom(void)
 {
-	int ret, i;
+	int uninitialized_var(ret);
+	int i;
 	void *p;
 #ifdef CONFIG_SYS_EEPROM_BUS_NUM
 	unsigned int bus;
-- 
1.6.3.3


More information about the U-Boot mailing list