Skip to contentSkip to conversation

env_sf: remove warning introduced with last patch

PATCH New Stefano Babic 3 participants 5 messages Oct 28, 2010 – Oct 29, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 env_sf: remove warning introduced with last patch

---
 common/env_sf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/env_sf.c +1 -1
index a597b24..e5e0166 100644
@@ -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;
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 env_sf: remove warning introduced with last patch

Quoted 10 lines · Stefano Babic

---
?common/env_sf.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

common/env_sf.c +0 -0
index a597b24..e5e0166 100644

common/env_sf.c int saveenv(void) · line 278

Quoted 8 lines
common/env_sf.c +1 -1
@@ -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

#2 lore raw

PATCH 1/1 env_sf: remove warning introduced with last patch

Quoted 8 lines · Mike Frysinger

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

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#3 lore raw

PATCH v2 1/1 env_sf: remove warning introduced with last patch

In reply to Stefano Babic
---
 common/env_sf.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
common/env_sf.c +1 -2
index a597b24..47c6a70 100644
@@ -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,
Signature · 1 line
1.7.1
#4 lore raw

PATCH v2 1/1 env_sf: remove warning introduced with last patch

Dear Stefano Babic,

Quoted 4 lines · In message <[email protected]> you wrote:
---
 common/env_sf.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Never call a man a fool.  Borrow from him.