public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Simon South <simon@simonsouth.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 0/2] Small fixes to SPL/TPL logging
Date: Wed,  2 Oct 2019 10:55:05 -0400	[thread overview]
Message-ID: <cover.1570026253.git.simon@simonsouth.net> (raw)

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

             reply	other threads:[~2019-10-02 14:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 14:55 Simon South [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1570026253.git.simon@simonsouth.net \
    --to=simon@simonsouth.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox