From: Thorsten Blum <thorsten.blum@linux.dev>
To: Eli Billauer <eli.billauer@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>, linux-kernel@vger.kernel.org
Subject: [PATCH] char: xillybus: use strscpy() in init_chrdev
Date: Mon, 27 Apr 2026 19:37:32 +0200 [thread overview]
Message-ID: <20260427173730.418592-3-thorsten.blum@linux.dev> (raw)
The format specifier is unnecessary and can be removed. Replace
snprintf("%s") with the faster and more direct strscpy().
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/char/xillybus/xillybus_class.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/char/xillybus/xillybus_class.c b/drivers/char/xillybus/xillybus_class.c
index c92a628e389e..bbdfa3e87514 100644
--- a/drivers/char/xillybus/xillybus_class.c
+++ b/drivers/char/xillybus/xillybus_class.c
@@ -11,6 +11,7 @@
#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/slab.h>
+#include <linux/string.h>
#include <linux/list.h>
#include <linux/mutex.h>
@@ -65,7 +66,7 @@ int xillybus_init_chrdev(struct device *dev,
mutex_lock(&unit_mutex);
if (!enumerate)
- snprintf(unit->name, UNITNAMELEN, "%s", prefix);
+ strscpy(unit->name, prefix);
for (i = 0; enumerate; i++) {
snprintf(unit->name, UNITNAMELEN, "%s_%02d",
next reply other threads:[~2026-04-27 17:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 17:37 Thorsten Blum [this message]
2026-04-28 8:37 ` [PATCH] char: xillybus: use strscpy() in init_chrdev Eli Billauer
2026-04-28 8:55 ` Thorsten Blum
2026-04-28 9:05 ` Eli Billauer
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=20260427173730.418592-3-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=arnd@arndb.de \
--cc=eli.billauer@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/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.