All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] genirq/proc:Replace snprintf with strscpy
@ 2026-02-03 11:20 qiubowen
  2026-02-03 12:54 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: qiubowen @ 2026-02-03 11:20 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, qiubowen

Replace snprintf with strscpy for better performance.

Signed-off-by: qiubowen <qiubowen523@gmail.com>
---
 kernel/irq/proc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 77258eafbf63..6aa974d2a01e 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -12,6 +12,7 @@
 #include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
 #include <linux/mutex.h>
+#include <linux/string.h>
 
 #include "internals.h"
 
@@ -317,7 +318,7 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
 	if (!desc->dir || action->dir || !action->name || !name_unique(irq, action))
 		return;
 
-	snprintf(name, MAX_NAMELEN, "%s", action->name);
+	strscpy(name, action->name, MAX_NAMELEN);
 
 	/* create /proc/irq/1234/handler/ */
 	action->dir = proc_mkdir(name, desc->dir);
-- 
2.43.0


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

end of thread, other threads:[~2026-02-03 12:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-03 11:20 [PATCH] genirq/proc:Replace snprintf with strscpy qiubowen
2026-02-03 12:54 ` Thomas Gleixner

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.