From 56e5af823363e9de2bfd3ccf028fe0a87b89e9c7 Mon Sep 17 00:00:00 2001 From: Tim Hardisty <56726697+TimJTi@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:57:23 +0100 Subject: [PATCH] nxboot/loader: Fix boot progress calculation. This patch corrects a mathematical error in the progress reporting function which caused incorrect percentage progress calculations. Signed-off-by: Tim Hardisty --- boot/nxboot/loader/boot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boot/nxboot/loader/boot.c b/boot/nxboot/loader/boot.c index 42f83a66e2e..f7a24c7cd34 100644 --- a/boot/nxboot/loader/boot.c +++ b/boot/nxboot/loader/boot.c @@ -162,7 +162,7 @@ static int copy_partition(int from, int where, struct nxboot_state *state, } #ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT - total_size = remain * 100; + total_size = remain; #endif blocksize = info_where.blocksize; @@ -227,7 +227,7 @@ static int copy_partition(int from, int where, struct nxboot_state *state, { #ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT nxboot_progress(nxboot_progress_percent, - ((total_size - remain) * 100) / total_size); + 100 - ((100 * remain) / total_size)); #else nxboot_progress(nxboot_progress_dot); #endif