From: Thorsten Blum <thorsten.blum@linux.dev>
To: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>,
Christian Gromm <christian.gromm@microchip.com>
Cc: Thorsten Blum <thorsten.blum@linux.dev>, linux-kernel@vger.kernel.org
Subject: [PATCH] most: replace snprintf("%s") with strscpy in audio_probe_channel
Date: Wed, 29 Apr 2026 02:08:59 +0200 [thread overview]
Message-ID: <20260429000858.1442-3-thorsten.blum@linux.dev> (raw)
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:
next reply other threads:[~2026-04-29 0:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 0:08 Thorsten Blum [this message]
2026-06-04 15:29 ` [PATCH] most: replace snprintf("%s") with strscpy in audio_probe_channel Thorsten Blum
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=20260429000858.1442-3-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=christian.gromm@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=parthiban.veerasooran@microchip.com \
/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.