summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 89316b5)
raw | patch | inline | side by side (parent: 89316b5)
author | Jean-Jacques Hiblot <jjhiblot@ti.com> | |
Fri, 16 Dec 2016 15:38:51 +0000 (16:38 +0100) | ||
committer | Lokesh Vutla <lokeshvutla@ti.com> | |
Mon, 19 Dec 2016 03:56:32 +0000 (09:26 +0530) |
With capacities getting bigger, we can see see messages with negative
numbers like "Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)".
Here the printed LBA is -387938128 when it should have been 3907029168.
To fix this, use the right format when displaying the unsigned integers.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reported-by: Yan Liu <yan-liu@ti.com>
numbers like "Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)".
Here the printed LBA is -387938128 when it should have been 3907029168.
To fix this, use the right format when displaying the unsigned integers.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reported-by: Yan Liu <yan-liu@ti.com>
disk/part.c | patch | blob | history |
diff --git a/disk/part.c b/disk/part.c
index 543cab8103204e0bc8fcba57e8b1b0474b4fe1bd..d93a6430672fa3fa2ac3891fe3879a642396a7a0 100644 (file)
--- a/disk/part.c
+++ b/disk/part.c
printf (" Supports 48-bit addressing\n");
#endif
#if defined(CONFIG_SYS_64BIT_LBA)
- printf (" Capacity: %ld.%ld MB = %ld.%ld GB (%Ld x %ld)\n",
+ printf (" Capacity: %lu.%lu MB = %lu.%lu GB (%llu x %lu)\n",
mb_quot, mb_rem,
gb_quot, gb_rem,
lba,
dev_desc->blksz);
#else
- printf (" Capacity: %ld.%ld MB = %ld.%ld GB (%ld x %ld)\n",
+ printf (" Capacity: %lu.%lu MB = %lu.%lu GB (%lu x %lu)\n",
mb_quot, mb_rem,
gb_quot, gb_rem,
(ulong)lba,