All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cmd/ubi.c: Fix format warning
@ 2018-07-26 15:32 Tom Rini
  2018-07-26 15:36 ` Martin Husemann
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Rini @ 2018-07-26 15:32 UTC (permalink / raw)
  To: u-boot

On 64bit platforms we would otherwise see:
../cmd/ubi.c: In function 'ubi_volume_read':
../cmd/ubi.c:359:16: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t {aka long unsigned int}' [-Wformat=]

Fixes: 68c7025d99db ("cmd: ubi: print load size after establishing volume size")
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 cmd/ubi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/ubi.c b/cmd/ubi.c
index 0e935e34b8e6..04bbd01da396 100644
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -356,7 +356,7 @@ int ubi_volume_read(char *volume, char *buf, size_t size)
 		size = vol->used_bytes;
 	}
 
-	printf("Read %u bytes from volume %s to %p\n", size, volume, buf);
+	printf("Read %zd bytes from volume %s to %p\n", size, volume, buf);
 
 	if (vol->corrupted)
 		printf("read from corrupted volume %d", vol->vol_id);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] cmd/ubi.c: Fix format warning
  2018-07-26 15:32 [U-Boot] [PATCH] cmd/ubi.c: Fix format warning Tom Rini
@ 2018-07-26 15:36 ` Martin Husemann
  2018-07-26 15:42   ` Tom Rini
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Husemann @ 2018-07-26 15:36 UTC (permalink / raw)
  To: u-boot

On Thu, Jul 26, 2018 at 11:32:25AM -0400, Tom Rini wrote:
> -	printf("Read %u bytes from volume %s to %p\n", size, volume, buf);
> +	printf("Read %zd bytes from volume %s to %p\n", size, volume, buf);

Why make it signed? "%zu bytes" should be better.

Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] cmd/ubi.c: Fix format warning
  2018-07-26 15:36 ` Martin Husemann
@ 2018-07-26 15:42   ` Tom Rini
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Rini @ 2018-07-26 15:42 UTC (permalink / raw)
  To: u-boot

On Thu, Jul 26, 2018 at 05:36:01PM +0200, Martin Husemann wrote:
> On Thu, Jul 26, 2018 at 11:32:25AM -0400, Tom Rini wrote:
> > -	printf("Read %u bytes from volume %s to %p\n", size, volume, buf);
> > +	printf("Read %zd bytes from volume %s to %p\n", size, volume, buf);
> 
> Why make it signed? "%zu bytes" should be better.

Whoops, thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180726/cb380d67/attachment.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-26 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-26 15:32 [U-Boot] [PATCH] cmd/ubi.c: Fix format warning Tom Rini
2018-07-26 15:36 ` Martin Husemann
2018-07-26 15:42   ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.