]> git.baikalelectronics.ru Git - uboot.git/commit
display_options: Do not use %llu in print_size
authorMatwey V. Kornilov <matwey.kornilov@gmail.com>
Thu, 5 Aug 2021 21:22:58 +0000 (00:22 +0300)
committerTom Rini <trini@konsulko.com>
Sat, 21 Aug 2021 22:23:02 +0000 (18:23 -0400)
commit2ae68d9f8ca610b52f9d3b2f43c5561171f9d206
tree6c264e81a6783440d68f3666f9546299a10125b5
parent2a4d42e6f7c26c9d9058d5484ab6e9fc270ddc6a
display_options: Do not use %llu in print_size

tiny-printf variant doesn't know how to handle %llu format string, but both
tiny-printf and print_size can meet in SPL when TFTP is used to obtain main
u-boot image. This is known to lead to critical boot issue at AM335x platform
when printf is catched in infinite loop.

To avoid such issues and make print_size function tiny-printf friendly, use %u
instead of %luu. Note, that the size value is guaranteed to be less than 1024
in this conditional branch, so the cast to unsigned int is safe.

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
lib/display_options.c