[U-Boot] [PATCH 2/2] fsl: sys_eeprom: Fix 'may be used uninitialized' warning
Kumar Gala
galak at kernel.crashing.org
Tue Sep 1 19:30:53 CEST 2009
On Sep 1, 2009, at 11:59 AM, Anton Vorontsov wrote:
> 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;
why don't we init ret = 0; seems like we should be doing that since
we might not enter the for loop
- k
More information about the U-Boot
mailing list