[U-Boot] [PATCH] env_sf: remove warning introduced with last patch

Signed-off-by: Stefano Babic sbabic@denx.de --- common/env_sf.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/env_sf.c b/common/env_sf.c index a597b24..e5e0166 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -272,7 +272,7 @@ int saveenv(void) u32 saved_size, saved_offset; char *saved_buffer = NULL; u32 sector = 1; - int ret; + int ret = 1; env_t env_new; char *res; ssize_t len;

On Thu, Oct 28, 2010 at 6:39 AM, Stefano Babic wrote:
Signed-off-by: Stefano Babic sbabic@denx.de
common/env_sf.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/env_sf.c b/common/env_sf.c index a597b24..e5e0166 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -272,7 +272,7 @@ int saveenv(void) u32 saved_size, saved_offset; char *saved_buffer = NULL; u32 sector = 1;
- int ret;
- int ret = 1;
env_t env_new; char *res; ssize_t len;
if you're going to start at 1, shouldnt you then drop the redundant assignment to 1 ? if (!saved_buffer) { ret = 1; goto done; } -mike

On 10/28/2010 07:47 PM, Mike Frysinger wrote:
if you're going to start at 1, shouldnt you then drop the redundant assignment to 1 ? if (!saved_buffer) { ret = 1; goto done; } -mike
Yes, it is redundant - I'll drop it.
Stefano

Signed-off-by: Stefano Babic sbabic@denx.de --- common/env_sf.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/common/env_sf.c b/common/env_sf.c index a597b24..47c6a70 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -272,7 +272,7 @@ int saveenv(void) u32 saved_size, saved_offset; char *saved_buffer = NULL; u32 sector = 1; - int ret; + int ret = 1; env_t env_new; char *res; ssize_t len; @@ -293,7 +293,6 @@ int saveenv(void) saved_offset = CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE; saved_buffer = malloc(saved_size); if (!saved_buffer) { - ret = 1; goto done; } ret = spi_flash_read(env_flash, saved_offset,

Dear Stefano Babic,
In message 1288345785-18990-1-git-send-email-sbabic@denx.de you wrote:
Signed-off-by: Stefano Babic sbabic@denx.de
common/env_sf.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
participants (3)
-
Mike Frysinger
-
Stefano Babic
-
Wolfgang Denk