Skip to content
Commit d179018e authored by This contributor prefers not to receive mails's avatar This contributor prefers not to receive mails Committed by Tom Rini
Browse files

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: default avatarPali Rohár <pali@kernel.org>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent 6f915a5d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment