Skip to content

Commit 368097b

Browse files
committed
nxboot/boot/nxboot/loader/boot.c: Correct mathematical error.
This patch corrects a mathematical error in the progress reporting function which caused incorrect percentage progress calculations. Signed-off-by: Tim Hardisty <timh@jti.uk.com>
1 parent e6a335d commit 368097b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

boot/nxboot/loader/boot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static int copy_partition(int from, int where, struct nxboot_state *state,
162162
}
163163

164164
#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT
165-
total_size = remain * 100;
165+
total_size = remain;
166166
#endif
167167
blocksize = MAX(info_from.blocksize, info_where.blocksize);
168168

@@ -227,7 +227,7 @@ static int copy_partition(int from, int where, struct nxboot_state *state,
227227
{
228228
#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT
229229
nxboot_progress(nxboot_progress_percent,
230-
((total_size - remain) * 100) / total_size);
230+
100 - ((100 * remain) / total_size));
231231
#else
232232
nxboot_progress(nxboot_progress_dot);
233233
#endif

0 commit comments

Comments
 (0)