From: Christoph Niedermaier <cniedermaier@dh-electronics.com>
To: Tom Rini <trini@konsulko.com>
Cc: "u-boot@lists.denx.de" <u-boot@lists.denx.de>,
Simon Glass <sjg@chromium.org>, Michael Walle <mwalle@kernel.org>,
Quentin Schulz <quentin.schulz@cherry.de>,
Marek Vasut <marex@denx.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 V3] tiny-printf: Handle formatting of %p with an extra Kconfig
Date: Thu, 8 May 2025 11:56:08 +0000 [thread overview]
Message-ID: <5a3217a732794dfc8e07e53436cbee2a@dh-electronics.com> (raw)
In-Reply-To: <20250507174233.GA491506@bill-the-cat>
From: Tom Rini <trini@konsulko.com>
Sent: Wednesday, May 7, 2025 7:43 PM
> On Wed, Apr 30, 2025 at 12:35:48PM +0200, 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.
>>
>> Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
>> ---
>> Cc: Tom Rini <trini@konsulko.com>
>> Cc: Simon Glass <sjg@chromium.org>
>> Cc: Michael Walle <mwalle@kernel.org>
>> Cc: Quentin Schulz <quentin.schulz@cherry.de>
>> Cc: Marek Vasut <marex@denx.de>
>> Cc: Benedikt Spranger <b.spranger@linutronix.de>
>> Cc: Jerome Forissier <jerome.forissier@linaro.org>
>> Cc: John Ogness <john.ogness@linutronix.de>
>> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
>> ---
>> V2: - Rebase on current master
>> - Extend commit message
>> - Restrict use to SPL
>> - Rename Kconfig to SPL_USE_TINY_PRINTF_POINTER_SUPPORT
>> - Replace _DEBUG with defined(DEBUG)
>> - Output '?' if %pm, %pM and %pI4 isn't available
>> - Add break on case '%'
>> V3: - Add missing output '?' for the default case
>> ---
>> Kconfig | 1 +
>> common/spl/Kconfig | 1 +
>> lib/Kconfig | 8 +++++++
>> lib/tiny-printf.c | 52 +++++++++++++++++++++++-----------------------
>> 4 files changed, 36 insertions(+), 26 deletions(-)
>>
>> diff --git a/Kconfig b/Kconfig
>> index 51358633762..b8eec3fc931 100644
>> --- a/Kconfig
>> +++ b/Kconfig
>> @@ -774,6 +774,7 @@ config NET
>>
>> config NET_LWIP
>> bool "Use lwIP for networking stack"
>> + select SPL_USE_TINY_PRINTF_POINTER_SUPPORT if SPL_USE_TINY_PRINTF
>> imply NETDEVICES
>> help
>> Include networking support based on the lwIP (lightweight IP)
>
> Sorry I missed this bug until now. This (and the subsequent parts of the
> patch referencing lwIP) aren't right. There's no SPL_NET_LWIP support
> (and not planned at this point), so what this does is grow platforms
> like xilinx_zynq_virt which use lwIP in U-Boot and tiny printf in SPL,
> but shouldn't since there's no SPL_NET_LWIP.
I didn't know that, I took it from the tiny printf pointer handling code.
I will remove all lwIP references in version 4.
Thanks and regards
Christoph
prev parent reply other threads:[~2025-05-08 11:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 10:35 [PATCH V3] tiny-printf: Handle formatting of %p with an extra Kconfig Christoph Niedermaier
2025-05-07 17:42 ` Tom Rini
2025-05-08 11:56 ` 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=5a3217a732794dfc8e07e53436cbee2a@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.