提交 ff5b706f 编写于 作者: W Weongyo Jeong 提交者: Thomas Gleixner

genirq: Remove unnecessary memset() calls

sprintf() and snprintf() implementation of kernel guarantees that
its result is terminated with null byte if size is larger than 0. So we
don't need to call memset() at all.
Signed-off-by: NWeongyo Jeong <weongyo.linux@gmail.com>
Link: http://lkml.kernel.org/r/1459451703-5744-1-git-send-email-weongyo.linux@gmail.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 fe3464ca
...@@ -311,7 +311,6 @@ void register_handler_proc(unsigned int irq, struct irqaction *action) ...@@ -311,7 +311,6 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
!name_unique(irq, action)) !name_unique(irq, action))
return; return;
memset(name, 0, MAX_NAMELEN);
snprintf(name, MAX_NAMELEN, "%s", action->name); snprintf(name, MAX_NAMELEN, "%s", action->name);
/* create /proc/irq/1234/handler/ */ /* create /proc/irq/1234/handler/ */
...@@ -340,7 +339,6 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc) ...@@ -340,7 +339,6 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc)
if (desc->dir) if (desc->dir)
goto out_unlock; goto out_unlock;
memset(name, 0, MAX_NAMELEN);
sprintf(name, "%d", irq); sprintf(name, "%d", irq);
/* create /proc/irq/1234 */ /* create /proc/irq/1234 */
...@@ -386,7 +384,6 @@ void unregister_irq_proc(unsigned int irq, struct irq_desc *desc) ...@@ -386,7 +384,6 @@ void unregister_irq_proc(unsigned int irq, struct irq_desc *desc)
#endif #endif
remove_proc_entry("spurious", desc->dir); remove_proc_entry("spurious", desc->dir);
memset(name, 0, MAX_NAMELEN);
sprintf(name, "%u", irq); sprintf(name, "%u", irq);
remove_proc_entry(name, root_irq_dir); remove_proc_entry(name, root_irq_dir);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册