genirq/proc: Replace snprintf with strscpy in register_handler_proc
PATCH 1/1 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 <[email protected]>
--- kernel/irq/proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/proc.c +2 -1
@@ -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);
Signature · 2 lines
Thorsten Blum <[email protected]> GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
The following commit has been merged into the irq/core branch of tip:
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 <[email protected]> AuthorDate: Tue, 27 Jan 2026 23:49:49 +01:00 Committer: Thomas Gleixner <[email protected]> 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 <[email protected]>
Signed-off-by Thomas Gleixner <[email protected]>
--- kernel/irq/proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/proc.c +2 -1
@@ -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);