public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Cheng Li <im.lechain@gmail.com>
Cc: "Willy Tarreau" <w@1wt.eu>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] tools/nolibc: support left alignment (-) and zero padding (0) in printf
Date: Fri, 30 Jan 2026 08:01:28 +0000	[thread overview]
Message-ID: <20260130080128.17cde0d3@pumpkin> (raw)
In-Reply-To: <CAAZOWcKtMqsFZ91yJAek6J4bBecgRrECzBjuuG20ooU_ZrKayw@mail.gmail.com>

On Fri, 30 Jan 2026 09:05:39 +0800
Cheng Li <im.lechain@gmail.com> wrote:

> David Laight <david.laight.linux@gmail.com> 于2026年1月29日周四 18:30写道:
... 
> These are great suggestions for a larger refactoring of printf to
> improve performance and standard compliance.
> However, to keep this current change minimal and safe, I prefer to
> focus on fixing the alignment feature first.
> 
> @Willy, I will send a v3 that removes the '0' flag handling logic to
> avoid the bug pointed out above.
> 
> I will rethink how to implement leading zero pad support.

You made me look at the code.
A simple refactor saved 98 bytes (about 10%).

I will look at adding support for field precision - which is what
is needed for leading zeros.
Will use up some of the saved space, but probably not all of it.

I'll base any patch on top of your change.

	David

  reply	other threads:[~2026-01-30  8:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-28  9:42 [PATCH v2 0/2] tools/nolibc: printf left alignment and zero padding licheng.li
2026-01-28  9:42 ` [PATCH v2 1/2] tools/nolibc: support left alignment (-) and zero padding (0) in printf licheng.li
2026-01-29  6:41   ` Willy Tarreau
2026-01-29  6:57     ` licheng
2026-01-29  7:07       ` Willy Tarreau
2026-01-29 10:30   ` David Laight
2026-01-30  1:05     ` Cheng Li
2026-01-30  8:01       ` David Laight [this message]
2026-01-30  9:52         ` Cheng Li
2026-01-28  9:42 ` [PATCH v2 2/2] selftests/nolibc: add tests for printf left alignment and zero padding licheng.li

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=20260130080128.17cde0d3@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=im.lechain@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=w@1wt.eu \
    /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