From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752671AbdHJMJL (ORCPT ); Thu, 10 Aug 2017 08:09:11 -0400 Received: from terminus.zytor.com ([65.50.211.136]:36105 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752466AbdHJMJK (ORCPT ); Thu, 10 Aug 2017 08:09:10 -0400 Date: Thu, 10 Aug 2017 05:05:38 -0700 From: tip-bot for Viresh Kumar Message-ID: Cc: viresh.kumar@linaro.org, peterz@infradead.org, vincent.guittot@linaro.org, mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, hpa@zytor.com Reply-To: torvalds@linux-foundation.org, hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, vincent.guittot@linaro.org, viresh.kumar@linaro.org, peterz@infradead.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/topology: Drop memset() from init_rootdomain() Git-Commit-ID: 4d13a06d54c415238325b0fe2c14f1052da4512f 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: 4d13a06d54c415238325b0fe2c14f1052da4512f Gitweb: http://git.kernel.org/tip/4d13a06d54c415238325b0fe2c14f1052da4512f Author: Viresh Kumar AuthorDate: Thu, 13 Apr 2017 14:45:48 +0530 Committer: Ingo Molnar CommitDate: Thu, 10 Aug 2017 12:18:13 +0200 sched/topology: Drop memset() from init_rootdomain() There are only two callers of init_rootdomain(). One of them passes a global to it and another one sends dynamically allocated root-domain. There is no need to memset the root-domain in the first case as the structure is already reset. Update alloc_rootdomain() to allocate the memory with kzalloc() and remove the memset() call from init_rootdomain(). Signed-off-by: Viresh Kumar Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Vincent Guittot Cc: linaro-kernel@lists.linaro.org Link: http://lkml.kernel.org/r/fc2f6cc90b098040970c85a97046512572d765bc.1492065513.git.viresh.kumar@linaro.org Signed-off-by: Ingo Molnar --- kernel/sched/topology.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 79895ae..216fee0 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -261,8 +261,6 @@ void rq_attach_root(struct rq *rq, struct root_domain *rd) static int init_rootdomain(struct root_domain *rd) { - memset(rd, 0, sizeof(*rd)); - if (!zalloc_cpumask_var(&rd->span, GFP_KERNEL)) goto out; if (!zalloc_cpumask_var(&rd->online, GFP_KERNEL)) @@ -311,7 +309,7 @@ static struct root_domain *alloc_rootdomain(void) { struct root_domain *rd; - rd = kmalloc(sizeof(*rd), GFP_KERNEL); + rd = kzalloc(sizeof(*rd), GFP_KERNEL); if (!rd) return NULL;