[PATCH 2/9] fastboot: use correct format specifier for size_t

Ahmad Fatoum a.fatoum at pengutronix.de
Tue May 27 13:13:52 PDT 2025


When we start checking for format specifier to be correct in a follow-up
commit, we will get warnings that we are printing a size_t as if it were
an int. Fix this.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 common/fastboot.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/fastboot.c b/common/fastboot.c
index 56bc4e82c4fe..de50797f31d8 100644
--- a/common/fastboot.c
+++ b/common/fastboot.c
@@ -398,7 +398,7 @@ void fastboot_download_finished(struct fastboot *fb)
 
 	printf("\n");
 
-	fastboot_tx_print(fb, FASTBOOT_MSG_INFO, "Downloading %d bytes finished",
+	fastboot_tx_print(fb, FASTBOOT_MSG_INFO, "Downloading %zu bytes finished",
 			  fb->download_bytes);
 
 	fastboot_tx_print(fb, FASTBOOT_MSG_OKAY, "");
@@ -421,7 +421,7 @@ static void cb_download(struct fastboot *fb, const char *cmd)
 	fb->download_size = simple_strtoul(cmd, NULL, 16);
 	fb->download_bytes = 0;
 
-	fastboot_tx_print(fb, FASTBOOT_MSG_INFO, "Downloading %d bytes...",
+	fastboot_tx_print(fb, FASTBOOT_MSG_INFO, "Downloading %zu bytes...",
 			  fb->download_size);
 
 	init_progression_bar(fb->download_size);
@@ -446,7 +446,7 @@ static void cb_download(struct fastboot *fb, const char *cmd)
 
 void fastboot_start_download_generic(struct fastboot *fb)
 {
-	fastboot_tx_print(fb, FASTBOOT_MSG_DATA, "%08x", fb->download_size);
+	fastboot_tx_print(fb, FASTBOOT_MSG_DATA, "%08zx", fb->download_size);
 }
 
 static void __maybe_unused cb_boot(struct fastboot *fb, const char *opt)
-- 
2.39.5




More information about the barebox mailing list