aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiddharth Vadapalli <s-vadapalli@ti.com>2023-08-14 10:23:47 +0530
committerTom Rini <trini@konsulko.com>2023-08-22 15:17:53 -0400
commit8f911a7be6bc631d2f4185f7d71025bf97f260e9 (patch)
treec1fd8a6a66dcf3997097ef65f365c45a8cf13251
parent4f543e82b9831333bc0effe9540d8e6a9dde3cb5 (diff)
downloadu-boot-WIP/2023-08-22-assorted-code-cleanups.zip
u-boot-WIP/2023-08-22-assorted-code-cleanups.tar.gz
u-boot-WIP/2023-08-22-assorted-code-cleanups.tar.bz2
net: Fix the displayed value of bytes transferredWIP/2023-08-22-assorted-code-cleanups
In the case of NETLOOP_SUCCESS, the decimal value of the u32 variable "net_boot_file_size" is printed using "%d", resulting in negative values being reported for large file sizes. Fix this by using "%u" to print the decimal value corresponding to the bytes transferred. Fixes: 1411157d8578 ("net: cosmetic: Fixup var names related to boot file") Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
-rw-r--r--net/net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/net.c b/net/net.c
index 43abbac..e6f61f0 100644
--- a/net/net.c
+++ b/net/net.c
@@ -716,7 +716,7 @@ restart:
case NETLOOP_SUCCESS:
net_cleanup_loop();
if (net_boot_file_size > 0) {
- printf("Bytes transferred = %d (%x hex)\n",
+ printf("Bytes transferred = %u (%x hex)\n",
net_boot_file_size, net_boot_file_size);
env_set_hex("filesize", net_boot_file_size);
env_set_hex("fileaddr", image_load_addr);