Skip to contentSkip to conversation

sched/fair: Remove unused but set variable 'rq'

PATCH New Tobias Klauser 2 participants 2 messages Oct 26, 2016 – Oct 27, 2016 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/fair: Remove unused but set variable 'rq'

Since commit 8663e24d56dc ("sched/fair: Reorder cgroup creation code"), the variable rq in alloc_fair_sched_group is set but no longer used. Remove it to fix the following GCC warning when building with 'W=1':

kernel/sched/fair.c:8842:13: warning: variable ‘rq’ set but not used [-Wunused-but-set-variable]

---
 kernel/sched/fair.c | 3 ---
 1 file changed, 3 deletions(-)
kernel/sched/fair.c +0 -3
index d941c97dfbc3..c242944f5cbd 100644
@@ -8839,7 +8839,6 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
 {
 	struct sched_entity *se;
 	struct cfs_rq *cfs_rq;
-	struct rq *rq;
 	int i;
 
 	tg->cfs_rq = kzalloc(sizeof(cfs_rq) * nr_cpu_ids, GFP_KERNEL);
@@ -8854,8 +8853,6 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
 	init_cfs_bandwidth(tg_cfs_bandwidth(tg));
 
 	for_each_possible_cpu(i) {
-		rq = cpu_rq(i);
-
 		cfs_rq = kzalloc_node(sizeof(struct cfs_rq),
 				      GFP_KERNEL, cpu_to_node(i));
 		if (!cfs_rq)
Signature · 1 line
2.9.0
#1 lore raw
sched/fair: Remove unused but set variable 'rq'
Commit-ID:  f5d6d2da0d9098a4aa0ebcc187aa0fc167045d6b
Gitweb:     http://git.kernel.org/tip/f5d6d2da0d9098a4aa0ebcc187aa0fc167045d6b
Author:     Tobias Klauser <[email protected]>
AuthorDate: Wed, 26 Oct 2016 13:37:04 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 27 Oct 2016 08:33:52 +0200

sched/fair: Remove unused but set variable 'rq'

Since commit:

8663e24d56dc ("sched/fair: Reorder cgroup creation code")

... the variable 'rq' in alloc_fair_sched_group() is set but no longer used. Remove it to fix the following GCC warning when building with 'W=1':

kernel/sched/fair.c:8842:13: warning: variable ‘rq’ set but not used [-Wunused-but-set-variable]

---
 kernel/sched/fair.c | 3 ---
 1 file changed, 3 deletions(-)
kernel/sched/fair.c +0 -3
index d941c97..c242944 100644
@@ -8839,7 +8839,6 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
 {
 	struct sched_entity *se;
 	struct cfs_rq *cfs_rq;
-	struct rq *rq;
 	int i;
 
 	tg->cfs_rq = kzalloc(sizeof(cfs_rq) * nr_cpu_ids, GFP_KERNEL);
@@ -8854,8 +8853,6 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
 	init_cfs_bandwidth(tg_cfs_bandwidth(tg));
 
 	for_each_possible_cpu(i) {
-		rq = cpu_rq(i);
-
 		cfs_rq = kzalloc_node(sizeof(struct cfs_rq),
 				      GFP_KERNEL, cpu_to_node(i));
 		if (!cfs_rq)