* [PATCH] most: replace snprintf("%s") with strscpy in audio_probe_channel
@ 2026-04-29 0:08 Thorsten Blum
2026-06-04 15:29 ` Thorsten Blum
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-04-29 0:08 UTC (permalink / raw)
To: Parthiban Veerasooran, Christian Gromm; +Cc: Thorsten Blum, linux-kernel
Replace snprintf("%s") with the faster and more direct strscpy().
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/most/most_snd.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/most/most_snd.c b/drivers/most/most_snd.c
index 68b9e6c64033..dc366813c31e 100644
--- a/drivers/most/most_snd.c
+++ b/drivers/most/most_snd.c
@@ -16,6 +16,7 @@
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <linux/sched.h>
+#include <linux/string.h>
#include <linux/kthread.h>
#include <linux/most.h>
@@ -554,10 +555,8 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
sizeof(*channel), &adpt->card);
if (ret < 0)
goto err_free_adpt;
- snprintf(adpt->card->driver, sizeof(adpt->card->driver),
- "%s", DRIVER_NAME);
- snprintf(adpt->card->shortname, sizeof(adpt->card->shortname),
- "Microchip INIC");
+ strscpy(adpt->card->driver, DRIVER_NAME);
+ strscpy(adpt->card->shortname, "Microchip INIC");
snprintf(adpt->card->longname, sizeof(adpt->card->longname),
"%s at %s", adpt->card->shortname, iface->description);
skip_adpt_alloc:
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] most: replace snprintf("%s") with strscpy in audio_probe_channel
2026-04-29 0:08 [PATCH] most: replace snprintf("%s") with strscpy in audio_probe_channel Thorsten Blum
@ 2026-06-04 15:29 ` Thorsten Blum
0 siblings, 0 replies; 2+ messages in thread
From: Thorsten Blum @ 2026-06-04 15:29 UTC (permalink / raw)
To: Parthiban Veerasooran, Christian Gromm; +Cc: linux-kernel
Gentle ping?
On Wed, Apr 29, 2026 at 02:08:59AM +0200, Thorsten Blum wrote:
> Replace snprintf("%s") with the faster and more direct strscpy().
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> drivers/most/most_snd.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/most/most_snd.c b/drivers/most/most_snd.c
> index 68b9e6c64033..dc366813c31e 100644
> --- a/drivers/most/most_snd.c
> +++ b/drivers/most/most_snd.c
> @@ -16,6 +16,7 @@
> #include <sound/pcm.h>
> #include <sound/pcm_params.h>
> #include <linux/sched.h>
> +#include <linux/string.h>
> #include <linux/kthread.h>
> #include <linux/most.h>
>
> @@ -554,10 +555,8 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
> sizeof(*channel), &adpt->card);
> if (ret < 0)
> goto err_free_adpt;
> - snprintf(adpt->card->driver, sizeof(adpt->card->driver),
> - "%s", DRIVER_NAME);
> - snprintf(adpt->card->shortname, sizeof(adpt->card->shortname),
> - "Microchip INIC");
> + strscpy(adpt->card->driver, DRIVER_NAME);
> + strscpy(adpt->card->shortname, "Microchip INIC");
> snprintf(adpt->card->longname, sizeof(adpt->card->longname),
> "%s at %s", adpt->card->shortname, iface->description);
> skip_adpt_alloc:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-04 15:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-29 0:08 [PATCH] most: replace snprintf("%s") with strscpy in audio_probe_channel Thorsten Blum
2026-06-04 15:29 ` Thorsten Blum
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.