]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
genirq/proc: Replace snprintf with strscpy in register_handler_proc
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 27 Jan 2026 22:49:49 +0000 (23:49 +0100)
committerThomas Gleixner <tglx@kernel.org>
Fri, 30 Jan 2026 07:53:53 +0000 (08:53 +0100)
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

index 77258eafbf632e99e24d7a50e4c8b3e481640886..b0999a4f1f6883c046d4d93322be3d8721a87d59 100644 (file)
@@ -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);