netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add scnprintf_append() helper
@ 2025-11-07  5:16 Junrui Luo
  2025-11-07  8:15 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Junrui Luo @ 2025-11-07  5:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: pmladek, rostedt, andriy.shevchenko, akpm, tiwai, perex,
	linux-sound, mchehab, awalls, linux-media, davem, edumazet, kuba,
	pabeni, netdev, Junrui Luo

This patch series was suggested by Takashi Iwai:
https://lore.kernel.org/all/874irai0ag.wl-tiwai@suse.de/

It introduces a generic scnprintf_append() helper function
to lib/vsprintf.c and converts several users across different subsystems.

The pattern of building strings incrementally using strlen() + sprintf/snprintf()
appears frequently throughout the kernel. This helper simplifies such code,
and provides proper bounds checking.

Patch 1 adds the scnprintf_append() helper to the kernel's string library.
This is a common pattern where strings are built incrementally by appending
formatted text.

Patches 2-4 convert users in different subsystems:
- Patch 2: sound/isa/wavefront
- Patch 3: drivers/media/pci/ivtv
- Patch 4: drivers/net/ethernet/qlogic/qede

These conversions demonstrate the helper's applicability.

Junrui Luo (4):
  lib/sprintf: add scnprintf_append() helper function
  ALSA: wavefront: use scnprintf_append for longname construction
  media: ivtv: use scnprintf_append for i2c adapter name
  net: qede: use scnprintf_append for version string

 drivers/media/pci/ivtv/ivtv-i2c.c            |  3 +-
 drivers/net/ethernet/qlogic/qede/qede_main.c |  7 ++--
 include/linux/sprintf.h                      |  1 +
 lib/vsprintf.c                               | 29 +++++++++++++++
 sound/isa/wavefront/wavefront.c              | 37 ++++++++++----------
 5 files changed, 52 insertions(+), 25 deletions(-)

-- 
2.51.1.dirty


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

* Re: [PATCH 0/4] Add scnprintf_append() helper
  2025-11-07  5:16 [PATCH 0/4] Add scnprintf_append() helper Junrui Luo
@ 2025-11-07  8:15 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2025-11-07  8:15 UTC (permalink / raw)
  To: Junrui Luo
  Cc: linux-kernel, pmladek, rostedt, akpm, tiwai, perex, linux-sound,
	mchehab, awalls, linux-media, davem, edumazet, kuba, pabeni,
	netdev

On Fri, Nov 07, 2025 at 01:16:12PM +0800, Junrui Luo wrote:
> This patch series was suggested by Takashi Iwai:
> https://lore.kernel.org/all/874irai0ag.wl-tiwai@suse.de/
> 
> It introduces a generic scnprintf_append() helper function
> to lib/vsprintf.c and converts several users across different subsystems.
> 
> The pattern of building strings incrementally using strlen() + sprintf/snprintf()
> appears frequently throughout the kernel. This helper simplifies such code,
> and provides proper bounds checking.
> 
> Patch 1 adds the scnprintf_append() helper to the kernel's string library.
> This is a common pattern where strings are built incrementally by appending
> formatted text.
> 
> Patches 2-4 convert users in different subsystems:
> - Patch 2: sound/isa/wavefront
> - Patch 3: drivers/media/pci/ivtv
> - Patch 4: drivers/net/ethernet/qlogic/qede
> 
> These conversions demonstrate the helper's applicability.

Something seems went wrong. This email is detached from the series (in terms of
the email thread). When formatting patches, use -v<X> --cover-letter to set
up the version number <X> and generate the cover letter that is chained to
the rest of the series.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2025-11-07  8:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-07  5:16 [PATCH 0/4] Add scnprintf_append() helper Junrui Luo
2025-11-07  8:15 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).