tiny-printf: Improve %X formatting
authorChristoph Niedermaier <cniedermaier@dh-electronics.com>
Thu, 20 Mar 2025 19:01:47 +0000 (20:01 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 8 Apr 2025 22:23:27 +0000 (16:23 -0600)
commit51b8679b94ea22ffb91925cf56df1950fd4b0e12
tree0f5df3e05accc33bbf2f10b4caac1ab6658e47af
parent9d9fbdab0e9664bff147109cc89ad2786f6ecd83
tiny-printf: Improve %X formatting

If tiny printf is used with 0x%08X (upper case X) the output is
always 0x00000000. It could be confusing if upper case instead
of lower case is used intentionally or accidentally because the
actual value is not output. To avoid this confusion, treat output
of %X as %x. As a compromise for tiny printf, the hex value is
then output correctly, but in lower case. This is done to keep it
tiny printf small.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
lib/tiny-printf.c