public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/2] Small fixes to SPL/TPL logging
@ 2019-10-02 14:55 Simon South
  2019-10-02 14:55 ` [U-Boot] [PATCH 1/2] common: Kconfig: Fix typo in TPL_LOG_CONSOLE description Simon South
  2019-10-02 14:55 ` [U-Boot] [PATCH 2/2] tiny-printf: Support vsnprintf() Simon South
  0 siblings, 2 replies; 5+ messages in thread
From: Simon South @ 2019-10-02 14:55 UTC (permalink / raw)
  To: u-boot

These two patches fix small issues I encountered when enabling
debugging output for U-Boot's TPL.

The first fixes a typo in the description of the TPL_LOG_CONSOLE
configuration option.

The second adds a simple implementation of vsnprintf() to the
tiny-printf library. Without this, enabling either SPL or TPL logging
for systems (such as the PINE64 ROCK64) that also use the tiny
printf() implementation causes the build to fail with error messages
like

    aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `_log':
    (...)/u-boot/common/log.c:212: undefined reference to `vsnprintf'
    make[1]: *** [scripts/Makefile.spl:404: spl/u-boot-spl] Error 1
    make: *** [Makefile:1762: spl/u-boot-spl] Error 2

To minimize the impact on code size, the function is built only when
logging is enabled, as it appears to be unneeded otherwise.

Note we could probably shave off a few bytes by having the existing
sprintf() and snprintf() functions call vsnprintf() when it's
available. I haven't made this change only because it isn't how the
existing code is written (printf() could call vprintf(), and
snprintf() could call sprintf(), yet neither do) and I assume this is
for a reason.

Simon South (2):
  common: Kconfig: Fix typo in TPL_LOG_CONSOLE description
  tiny-printf: Support vsnprintf()

 common/Kconfig    |  2 +-
 lib/tiny-printf.c | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

-- 
2.23.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-01 13:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-02 14:55 [U-Boot] [PATCH 0/2] Small fixes to SPL/TPL logging Simon South
2019-10-02 14:55 ` [U-Boot] [PATCH 1/2] common: Kconfig: Fix typo in TPL_LOG_CONSOLE description Simon South
2019-11-01 13:29   ` Tom Rini
2019-10-02 14:55 ` [U-Boot] [PATCH 2/2] tiny-printf: Support vsnprintf() Simon South
2019-11-01 13:29   ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox