Skip to content

Commit e3831ed

Browse files
Srivatsa S. BhatIngo Molnar
authored andcommitted
sched: Fix incorrect usage of for_each_cpu_mask() in select_fallback_rq()
The function for_each_cpu_mask() expects a *pointer* to struct cpumask as its second argument, whereas select_fallback_rq() passes the value itself. And moreover, for_each_cpu_mask() has been marked as obselete in include/linux/cpumask.h. So move to the more appropriate for_each_cpu() variant. Reported-by: Sasha Levin <[email protected]> Signed-off-by: Srivatsa S. Bhat <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Cc: Dave Jones <[email protected]> Cc: Liu Chuansheng <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 1f56ee7 commit e3831ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/sched/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
12681268
int dest_cpu;
12691269

12701270
/* Look for allowed, online CPU in same node. */
1271-
for_each_cpu_mask(dest_cpu, *nodemask) {
1271+
for_each_cpu(dest_cpu, nodemask) {
12721272
if (!cpu_online(dest_cpu))
12731273
continue;
12741274
if (!cpu_active(dest_cpu))
@@ -1279,7 +1279,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
12791279

12801280
for (;;) {
12811281
/* Any allowed, online CPU? */
1282-
for_each_cpu_mask(dest_cpu, *tsk_cpus_allowed(p)) {
1282+
for_each_cpu(dest_cpu, tsk_cpus_allowed(p)) {
12831283
if (!cpu_online(dest_cpu))
12841284
continue;
12851285
if (!cpu_active(dest_cpu))

0 commit comments

Comments
 (0)