All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] genirq/proc: Replace snprintf with strscpy in register_handler_proc
@ 2026-01-27 22:49 Thorsten Blum
  2026-01-30  8:08 ` [tip: irq/core] " tip-bot2 for Thorsten Blum
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-01-27 22:49 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Thorsten Blum, linux-kernel

Replace snprintf("%s", ...) with the faster and more direct strscpy().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 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..b0999a4f1f68 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);
 
 	/* create /proc/irq/1234/handler/ */
 	action->dir = proc_mkdir(name, desc->dir);
-- 
Thorsten Blum <thorsten.blum@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4


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

* [tip: irq/core] genirq/proc: Replace snprintf with strscpy in register_handler_proc
  2026-01-27 22:49 [PATCH] genirq/proc: Replace snprintf with strscpy in register_handler_proc Thorsten Blum
@ 2026-01-30  8:08 ` tip-bot2 for Thorsten Blum
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Thorsten Blum @ 2026-01-30  8:08 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Thorsten Blum, Thomas Gleixner, x86, linux-kernel, maz

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     2dfc417414c6eea4e167b2f46283cded846c531a
Gitweb:        https://git.kernel.org/tip/2dfc417414c6eea4e167b2f46283cded846c531a
Author:        Thorsten Blum <thorsten.blum@linux.dev>
AuthorDate:    Tue, 27 Jan 2026 23:49:49 +01:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Fri, 30 Jan 2026 08:53:53 +01:00

genirq/proc: Replace snprintf with strscpy in register_handler_proc

Replace snprintf("%s", ...) with the faster and more direct strscpy().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260127224949.441391-2-thorsten.blum@linux.dev
---
 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 77258ea..b0999a4 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);
 
 	/* create /proc/irq/1234/handler/ */
 	action->dir = proc_mkdir(name, desc->dir);

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

end of thread, other threads:[~2026-01-30  8:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-27 22:49 [PATCH] genirq/proc: Replace snprintf with strscpy in register_handler_proc Thorsten Blum
2026-01-30  8:08 ` [tip: irq/core] " tip-bot2 for 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.