Skip to contentSkip to conversation

cmd/ubi.c: Fix format warning

PATCH Superseded Tom Rini 1 participant 2 messages Jul 26, 2018

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH v2 1/1 cmd/ubi.c: Fix format warning

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")
---
 cmd/ubi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/ubi.c +1 -1
index 0e935e34b8e6..913f0f71fd99 100644
@@ -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 %zu bytes from volume %s to %p\n", size, volume, buf);
 
 	if (vol->corrupted)
 		printf("read from corrupted volume %d", vol->vol_id);
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v2 1/1 cmd/ubi.c: Fix format warning

Quoted 6 lines · Tom Rini

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")

Applied to u-boot/master, thanks!

Signature · 8 lines
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/fa85fa15/attachment.sig>