Skip to content

Commit 2dfc417

Browse files
tobluxThomas Gleixner
authored andcommitted
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
1 parent dd9f6d3 commit 2dfc417

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kernel/irq/proc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/interrupt.h>
1313
#include <linux/kernel_stat.h>
1414
#include <linux/mutex.h>
15+
#include <linux/string.h>
1516

1617
#include "internals.h"
1718

@@ -317,7 +318,7 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
317318
if (!desc->dir || action->dir || !action->name || !name_unique(irq, action))
318319
return;
319320

320-
snprintf(name, MAX_NAMELEN, "%s", action->name);
321+
strscpy(name, action->name);
321322

322323
/* create /proc/irq/1234/handler/ */
323324
action->dir = proc_mkdir(name, desc->dir);

0 commit comments

Comments
 (0)