From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932380AbcFJTqh (ORCPT ); Fri, 10 Jun 2016 15:46:37 -0400 Received: from terminus.zytor.com ([198.137.202.10]:34424 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751489AbcFJTqg (ORCPT ); Fri, 10 Jun 2016 15:46:36 -0400 Date: Fri, 10 Jun 2016 12:46:30 -0700 From: tip-bot for Weongyo Jeong Message-ID: Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, weongyo.linux@gmail.com Reply-To: weongyo.linux@gmail.com, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org In-Reply-To: <1459451703-5744-1-git-send-email-weongyo.linux@gmail.com> References: <1459451703-5744-1-git-send-email-weongyo.linux@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] genirq: Remove unnecessary memset() calls Git-Commit-ID: ff5b706f5189fe8d2a6fd576b491b769ec1d29d3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ff5b706f5189fe8d2a6fd576b491b769ec1d29d3 Gitweb: http://git.kernel.org/tip/ff5b706f5189fe8d2a6fd576b491b769ec1d29d3 Author: Weongyo Jeong AuthorDate: Thu, 31 Mar 2016 12:15:03 -0700 Committer: Thomas Gleixner CommitDate: Fri, 10 Jun 2016 17:07:50 +0200 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: Weongyo Jeong Link: http://lkml.kernel.org/r/1459451703-5744-1-git-send-email-weongyo.linux@gmail.com Signed-off-by: Thomas Gleixner --- kernel/irq/proc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 50a8f28..f30425d 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -311,7 +311,6 @@ void register_handler_proc(unsigned int irq, struct irqaction *action) !name_unique(irq, action)) return; - memset(name, 0, MAX_NAMELEN); snprintf(name, MAX_NAMELEN, "%s", action->name); /* create /proc/irq/1234/handler/ */ @@ -340,7 +339,6 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc) if (desc->dir) goto out_unlock; - memset(name, 0, MAX_NAMELEN); sprintf(name, "%d", irq); /* create /proc/irq/1234 */ @@ -386,7 +384,6 @@ void unregister_irq_proc(unsigned int irq, struct irq_desc *desc) #endif remove_proc_entry("spurious", desc->dir); - memset(name, 0, MAX_NAMELEN); sprintf(name, "%u", irq); remove_proc_entry(name, root_irq_dir); }