Skip to content

Commit 3fb2789

Browse files
author
Fox Snowpatch
committed
1 parent 182544a commit 3fb2789

5 files changed

Lines changed: 7 additions & 16 deletions

File tree

arch/powerpc/kernel/irq.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,7 @@ int irq_choose_cpu(const struct cpumask *mask)
370370
do_round_robin:
371371
raw_spin_lock_irqsave(&irq_rover_lock, flags);
372372

373-
irq_rover = cpumask_next(irq_rover, cpu_online_mask);
374-
if (irq_rover >= nr_cpu_ids)
375-
irq_rover = cpumask_first(cpu_online_mask);
376-
373+
irq_rover = cpumask_next_wrap(irq_rover, cpu_online_mask);
377374
cpuid = irq_rover;
378375

379376
raw_spin_unlock_irqrestore(&irq_rover_lock, flags);

arch/powerpc/kernel/setup-common.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,18 +323,15 @@ static int show_cpuinfo(struct seq_file *m, void *v)
323323
seq_putc(m, '\n');
324324

325325
/* If this is the last cpu, print the summary */
326-
if (cpumask_next(cpu_id, cpu_online_mask) >= nr_cpu_ids)
326+
if (cpu_id == cpumask_last(cpu_online_mask))
327327
show_cpuinfo_summary(m);
328328

329329
return 0;
330330
}
331331

332332
static void *c_start(struct seq_file *m, loff_t *pos)
333333
{
334-
if (*pos == 0) /* just in case, cpu 0 is not the first */
335-
*pos = cpumask_first(cpu_online_mask);
336-
else
337-
*pos = cpumask_next(*pos - 1, cpu_online_mask);
334+
*pos = cpumask_next(*pos - 1, cpu_online_mask);
338335
if ((*pos) < nr_cpu_ids)
339336
return (void *)(unsigned long)(*pos + 1);
340337
return NULL;

arch/powerpc/mm/book3s64/hash_utils.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,9 +1299,7 @@ static void stress_hpt_timer_fn(struct timer_list *timer)
12991299
if (!firmware_has_feature(FW_FEATURE_LPAR))
13001300
tlbiel_all();
13011301

1302-
next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask);
1303-
if (next_cpu >= nr_cpu_ids)
1304-
next_cpu = cpumask_first(cpu_online_mask);
1302+
next_cpu = cpumask_next_wrap(raw_smp_processor_id(), cpu_online_mask);
13051303
stress_hpt_timer.expires = jiffies + msecs_to_jiffies(10);
13061304
add_timer_on(&stress_hpt_timer, next_cpu);
13071305
}

arch/powerpc/perf/imc-pmu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ static int ppc_nest_imc_cpu_offline(unsigned int cpu)
421421
static int ppc_nest_imc_cpu_online(unsigned int cpu)
422422
{
423423
const struct cpumask *l_cpumask;
424-
static struct cpumask tmp_mask;
425424
int res;
426425

427426
/* Get the cpumask of this node */
@@ -431,7 +430,7 @@ static int ppc_nest_imc_cpu_online(unsigned int cpu)
431430
* If this is not the first online CPU on this node, then
432431
* just return.
433432
*/
434-
if (cpumask_and(&tmp_mask, l_cpumask, &nest_imc_cpumask))
433+
if (cpumask_intersects(l_cpumask, &nest_imc_cpumask))
435434
return 0;
436435

437436
/*
@@ -647,14 +646,13 @@ static bool is_core_imc_mem_inited(int cpu)
647646
static int ppc_core_imc_cpu_online(unsigned int cpu)
648647
{
649648
const struct cpumask *l_cpumask;
650-
static struct cpumask tmp_mask;
651649
int ret = 0;
652650

653651
/* Get the cpumask for this core */
654652
l_cpumask = cpu_sibling_mask(cpu);
655653

656654
/* If a cpu for this core is already set, then, don't do anything */
657-
if (cpumask_and(&tmp_mask, l_cpumask, &core_imc_cpumask))
655+
if (cpumask_intersects(l_cpumask, &core_imc_cpumask))
658656
return 0;
659657

660658
if (!is_core_imc_mem_inited(cpu)) {

arch/powerpc/sysdev/xive/common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ static int xive_find_target_in_mask(const struct cpumask *mask,
564564
return cpu;
565565
}
566566

567+
WARN_ONCE(1, "target CPU not found in mask: %*pbl\n", cpumask_pr_args(mask));
567568
return -1;
568569
}
569570

0 commit comments

Comments
 (0)