Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1607392

[PATCH 3/4] sched: cpupri: don't re-initialize struct cpupri

From Viresh Kumar <viresh.kumar@linaro.org>
Newsgroups linux.kernel
Subject [PATCH 3/4] sched: cpupri: don't re-initialize struct cpupri
Date 2017-03-23 12:40 +0100
Message-ID <to9fZ-1zG-29@gated-at.bofh.it> (permalink)
References <to9fY-1zG-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The struct cpupri passed to cpupri_init() is already initialized to
zero. Don't do that again.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 kernel/sched/cpupri.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c
index 981fcd7dc394..d6165d87ef3e 100644
--- a/kernel/sched/cpupri.c
+++ b/kernel/sched/cpupri.c
@@ -209,12 +209,9 @@ int cpupri_init(struct cpupri *cp)
 {
 	int i;
 
-	memset(cp, 0, sizeof(*cp));
-
 	for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) {
 		struct cpupri_vec *vec = &cp->pri_to_cpu[i];
 
-		atomic_set(&vec->count, 0);
 		if (!zalloc_cpumask_var(&vec->mask, GFP_KERNEL))
 			goto cleanup;
 	}
-- 
2.12.0.432.g71c3a4f4ba37

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] sched: Minor cleanups Viresh Kumar <viresh.kumar@linaro.org> - 2017-03-23 12:40 +0100
  [PATCH 1/4] sched: topology: drop memset() from init_rootdomain() Viresh Kumar <viresh.kumar@linaro.org> - 2017-03-23 12:40 +0100
  [PATCH 4/4] sched: core: drop useless expression from sched_init() Viresh Kumar <viresh.kumar@linaro.org> - 2017-03-23 12:40 +0100
  [PATCH 3/4] sched: cpupri: don't re-initialize struct cpupri Viresh Kumar <viresh.kumar@linaro.org> - 2017-03-23 12:40 +0100
  Re: [PATCH 0/4] sched: Minor cleanups Peter Zijlstra <peterz@infradead.org> - 2017-03-27 16:00 +0200

csiph-web