diff options
author | Pali Rohár <pali@kernel.org> | 2022-09-12 22:02:27 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-09-23 22:13:18 +0300 |
commit | d179018e4c9561afac5ca5c8878852f1171b836b (patch) | |
tree | 8ff2702026d701888ebc9145c4e567ff8ad31412 /common/board_f.c | |
parent | 6f915a5d24b1c8cf30a29d7edff01eb5951bef0b (diff) | |
download | u-boot-d179018e4c9561afac5ca5c8878852f1171b836b.tar.xz |
display_options: print_size: Fix order overflow
Function print_size() round size to the nearst value with one decimal
fraction number. But in special cases also unit order may overflow.
For example value 1073689396 is printed as "1024 MiB" and value 1073741824
as "1 GiB".
Fix this issue by detecting order overflow and increasing unit order.
With this change also value 1073689396 is printed as "1 GiB".
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/board_f.c')
0 files changed, 0 insertions, 0 deletions