From: Christoph Niedermaier <cniedermaier@dh-electronics.com>
To: Marek Vasut <marex@denx.de>,
"u-boot@lists.denx.de" <u-boot@lists.denx.de>
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
"Michael Walle" <mwalle@kernel.org>,
Quentin Schulz <quentin.schulz@cherry.de>,
Benedikt Spranger <b.spranger@linutronix.de>,
Jerome Forissier <jerome.forissier@linaro.org>,
John Ogness <john.ogness@linutronix.de>,
"Ilias Apalodimas" <ilias.apalodimas@linaro.org>
Subject: RE: [PATCH V2] tiny-printf: Handle formatting of %p with an extra Kconfig
Date: Wed, 30 Apr 2025 10:35:30 +0000 [thread overview]
Message-ID: <b8ad1ab5a2b14f7f8a895b855ca26990@dh-electronics.com> (raw)
In-Reply-To: <8c330a4933d0447394ce375b0548e966@dh-electronics.com>
From: Christoph Niedermaier
Sent: Tuesday, April 29, 2025 6:49 PM
> From: Marek Vasut <marex@denx.de>
> Sent: Tuesday, April 29, 2025 5:28 PM
>> On 4/29/25 4:47 PM, Christoph Niedermaier wrote:
>>> The formatting with %pa / %pap behaves like %x, which results in an
>>> incorrect value being output. To improve this, a new fine-tuning
>>> Kconfig SPL_USE_TINY_PRINTF_POINTER_SUPPORT for pointer formatting
>>> has been added. If it is enabled, the output of %pa / %pap should
>>> be correct, and if it is disabled, the pointer formatting is
>>> completely unsupported. In addition to indicate unsupported formatting,
>>> '?' will be output. This allows enabling pointer formatting only
>>> when needed. For SPL_NET and NET_LWIP it is selected by default.
>>> Then it also supports the formatting with %pm, %pM and %pI4.
>>>
>>> In summery this level of %p support for tiny printf is possible now:
>>>
>>> 1) The standard tiny printf won't have support for pointer formatting.
>>> So it doesn't print misleading values for %pa, instead '?' will be
>>> output:
>>> %p => ?
>>> %pa => ?a
>>> %pap => ?ap
>>>
>>> 2) If SPL_USE_TINY_PRINTF_POINTER_SUPPORT is enabled or DEBUG is defined
>>> tiny printf supports formatting %p and %pa / %pap.
>>>
>>> 3) If SPL_NET or NET_LWIP is enabled the support of pointers is extended
>>> for %pm, %pM and %pI4.
>> If you need rich printf formatting support , enable full printf instead?
>
> It is not about extending tiny printf with more formatting. The current
> support for pointers leads to the printing of misleading values. This patch
> removes the support for pointers, but makes the already existing pointer
> support for %pa / %pap optional. The existing support for %pm, %pM and %pI4
> enabled by SPL_NET or NET_LWIP CONF has remained functionally the same.
Sorry, I have noticed that in V2 the output of '?' is missing in the
default case. I will fix it in V3.
Regards
Christoph
prev parent reply other threads:[~2025-04-30 10:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-29 14:47 [PATCH V2] tiny-printf: Handle formatting of %p with an extra Kconfig Christoph Niedermaier
2025-04-29 15:28 ` Marek Vasut
2025-04-29 16:49 ` Christoph Niedermaier
2025-04-30 10:35 ` Christoph Niedermaier [this message]
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=b8ad1ab5a2b14f7f8a895b855ca26990@dh-electronics.com \
--to=cniedermaier@dh-electronics.com \
--cc=b.spranger@linutronix.de \
--cc=ilias.apalodimas@linaro.org \
--cc=jerome.forissier@linaro.org \
--cc=john.ogness@linutronix.de \
--cc=marex@denx.de \
--cc=mwalle@kernel.org \
--cc=quentin.schulz@cherry.de \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--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