Patchwork [U-Boot,4/7] GCC4.6: Squash warning in cmd_nvedit.c

login
register
mail settings
Submitter Marek Vasut
Date Sept. 26, 2011, 12:26 a.m.
Message ID <1316996766-14248-4-git-send-email-marek.vasut@gmail.com>
Download mbox | patch
Permalink /patch/116336/
State Accepted
Commit 7fcd9bbd6f0a69fb41b097cc8fd11d1ef21519e8
Headers show

Comments

Marek Vasut - Sept. 26, 2011, 12:26 a.m.
cmd_nvedit.c: In function ‘do_env_edit’:
cmd_nvedit.c:463:6: warning: variable ‘len’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 common/cmd_nvedit.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Mike Frysinger - Sept. 26, 2011, 3:39 a.m.
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
Mike Frysinger - Sept. 26, 2011, 3:40 a.m.
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
Simon Glass - Sept. 26, 2011, 6:15 p.m.
On Sun, Sep 25, 2011 at 5:26 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> cmd_nvedit.c: In function ‘do_env_edit’:
> cmd_nvedit.c:463:6: warning: variable ‘len’ set but not used
> [-Wunused-but-set-variable]
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>

I need this also!

Acked-by: Simon Glass <sjg@chromium.org>

> ---
>  common/cmd_nvedit.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
> index e8b116d..101bc49 100644
> --- a/common/cmd_nvedit.c
> +++ b/common/cmd_nvedit.c
> @@ -460,7 +460,6 @@ int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  {
>        char buffer[CONFIG_SYS_CBSIZE];
>        char *init_val;
> -       int len;
>
>        if (argc < 2)
>                return cmd_usage(cmdtp);
> @@ -468,7 +467,7 @@ int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>        /* Set read buffer to initial value or empty sting */
>        init_val = getenv(argv[1]);
>        if (init_val)
> -               len = sprintf(buffer, "%s", init_val);
> +               sprintf(buffer, "%s", init_val);
>        else
>                buffer[0] = '\0';
>
> --
> 1.7.5.4
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
Wolfgang Denk - Oct. 1, 2011, 9:26 p.m.
Dear Marek Vasut,

In message <1316996766-14248-4-git-send-email-marek.vasut@gmail.com> you wrote:
> cmd_nvedit.c: In function `do_env_edit´:
> cmd_nvedit.c:463:6: warning: variable `len´ set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> ---
>  common/cmd_nvedit.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index e8b116d..101bc49 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -460,7 +460,6 @@  int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char buffer[CONFIG_SYS_CBSIZE];
 	char *init_val;
-	int len;
 
 	if (argc < 2)
 		return cmd_usage(cmdtp);
@@ -468,7 +467,7 @@  int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	/* Set read buffer to initial value or empty sting */
 	init_val = getenv(argv[1]);
 	if (init_val)
-		len = sprintf(buffer, "%s", init_val);
+		sprintf(buffer, "%s", init_val);
 	else
 		buffer[0] = '\0';