Patchwork [U-Boot,1/3] fw_env: fix type of len

login
register
mail settings
Submitter Mike Frysinger
Date Nov. 11, 2012, 5:47 a.m.
Message ID <1352612867-32354-1-git-send-email-vapier@gentoo.org>
Download mbox | patch
Permalink /patch/198241/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Mike Frysinger - Nov. 11, 2012, 5:47 a.m.
This variable is assigned by a size_t, and is printed that way, but is
incorrectly declared as an int.  Which means we get warnings:
fw_env.c: In function 'fw_setenv':
fw_env.c:409:5: warning: format '%zu' expects argument of type 'size_t',
	but argument 3 has type 'int' [-Wformat]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 tools/env/fw_env.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Joe Hershberger - Dec. 15, 2012, 5:58 p.m.
Hi Mike,

On Sat, Nov 10, 2012 at 11:47 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> This variable is assigned by a size_t, and is printed that way, but is
> incorrectly declared as an int.  Which means we get warnings:
> fw_env.c: In function 'fw_setenv':
> fw_env.c:409:5: warning: format '%zu' expects argument of type 'size_t',
>         but argument 3 has type 'int' [-Wformat]
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Tom Rini - Dec. 19, 2012, 11 p.m.
On Sat, Nov 10, 2012 at 07:47:45PM -0000, Mike Frysinger wrote:

> This variable is assigned by a size_t, and is printed that way, but is
> incorrectly declared as an int.  Which means we get warnings:
> fw_env.c: In function 'fw_setenv':
> fw_env.c:409:5: warning: format '%zu' expects argument of type 'size_t',
> 	but argument 3 has type 'int' [-Wformat]
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>

For the series, applied to u-boot/master, thanks!
Joe Hershberger - Dec. 20, 2012, 5:47 a.m.
Hi Tom,

On Wed, Dec 19, 2012 at 5:00 PM, Tom Rini <trini@ti.com> wrote:
> On Sat, Nov 10, 2012 at 07:47:45PM -0000, Mike Frysinger wrote:
>
>> This variable is assigned by a size_t, and is printed that way, but is
>> incorrectly declared as an int.  Which means we get warnings:
>> fw_env.c: In function 'fw_setenv':
>> fw_env.c:409:5: warning: format '%zu' expects argument of type 'size_t',
>>       but argument 3 has type 'int' [-Wformat]
>>
>> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
>
> For the series, applied to u-boot/master, thanks!

I NACKed the third in this series.  Did you not see it?

-Joe
Tom Rini - Dec. 20, 2012, 2:25 p.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/20/12 00:47, Joe Hershberger wrote:
> Hi Tom,
> 
> On Wed, Dec 19, 2012 at 5:00 PM, Tom Rini <trini@ti.com> wrote:
>> On Sat, Nov 10, 2012 at 07:47:45PM -0000, Mike Frysinger wrote:
>> 
>>> This variable is assigned by a size_t, and is printed that way,
>>> but is incorrectly declared as an int.  Which means we get
>>> warnings: fw_env.c: In function 'fw_setenv': fw_env.c:409:5:
>>> warning: format '%zu' expects argument of type 'size_t', but
>>> argument 3 has type 'int' [-Wformat]
>>> 
>>> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Joe
>>> Hershberger <joe.hershberger@ni.com>
>> 
>> For the series, applied to u-boot/master, thanks!
> 
> I NACKed the third in this series.  Did you not see it?

Yeah, I missed that, sorry.

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQ0x/nAAoJENk4IS6UOR1WJ+IP/2g/Gb25k5WwKLG9LJWGp+ve
h173Xt1GhMWB8tutmEd1zc4Gat/ZhFv8PO6SxlR/3RxTZzNkg7v74SBkNnglHQVa
cvYIgzb72QvpIl7gHITHA38XedcV0UjEIJmlV6alqbZ/z4XBlNr/5Z71lwmI6VdM
H+yopRxmxXAtthTHNfyTyF6+MVItlCY15RkKFTvv93Pof1CRtRLI1jL5+497VtbS
hi7Fao2N/bHBUVkjQDU3hKOyApTNJhMBgxPu9EZszeAYqNLCNMH6FT4HvUNkYIjT
OEyG8bfm5D+v4x79fmLuLwPRg+yaBKu4nVJe7pzeTsQKfM3loIvyoaci2DLm9afS
ybmf97tRafMBYYiOTGJoRH3LXubCs1NZNgQIwCcDC9q59qy1E+uxp2jhBx/xfqGF
ixlz3A+J0c9Ahfjybejf9Y1M3I/3Sbyx6/fJR7jZsQo/lJROkp4W+yJHcmSzLqQO
jufYVZNi5lYo73R11TUa2oXngoBNW7jY4A9JHSA06JoB+GHp8Ze6yTFZD0QviTkY
oAWNHMvTFqzvC4UAHLXOGiiBTuxVaCd8nOR2/z/BzcKEHJuTTJxwe0ABB/FU9o3b
wF1MxwONT3/kfYA5eDItbjGaSa6NyY/66czjFSZjO0YJFZEKwKtLigwcgKw6Krq+
Mfv8c0WC0IXzgYikHFMm
=Fiob
-----END PGP SIGNATURE-----

Patch

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 9b023e8..02f97c0 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -379,7 +379,8 @@  int fw_env_write(char *name, char *value)
  */
 int fw_setenv(int argc, char *argv[])
 {
-	int i, len;
+	int i;
+	size_t len;
 	char *name;
 	char *value = NULL;