Skip to content

Commit dc5bb9b

Browse files
committed
cpumask: deprecate cpumask_next_wrap()
The next patch aligns implementation of cpumask_next_wrap() with the find_next_bit_wrap(), and it changes function signature. To make the transition smooth, this patch deprecates current implementation by adding an _old suffix. The following patches switch current users to the new implementation one by one. No functional changes were intended. Signed-off-by: Yury Norov <[email protected]>
1 parent 40ba13b commit dc5bb9b

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

arch/s390/kernel/processor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void notrace stop_machine_yield(const struct cpumask *cpumask)
7272
this_cpu = smp_processor_id();
7373
if (__this_cpu_inc_return(cpu_relax_retry) >= spin_retry) {
7474
__this_cpu_write(cpu_relax_retry, 0);
75-
cpu = cpumask_next_wrap(this_cpu, cpumask, this_cpu, false);
75+
cpu = cpumask_next_wrap_old(this_cpu, cpumask, this_cpu, false);
7676
if (cpu >= nr_cpu_ids)
7777
return;
7878
if (arch_vcpu_is_preempted(cpu))

drivers/pci/controller/pci-hyperv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,7 @@ static int hv_compose_multi_msi_req_get_cpu(void)
17571757

17581758
spin_lock_irqsave(&multi_msi_cpu_lock, flags);
17591759

1760-
cpu_next = cpumask_next_wrap(cpu_next, cpu_online_mask, nr_cpu_ids,
1760+
cpu_next = cpumask_next_wrap_old(cpu_next, cpu_online_mask, nr_cpu_ids,
17611761
false);
17621762
cpu = cpu_next;
17631763

drivers/scsi/lpfc/lpfc_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12873,7 +12873,7 @@ lpfc_irq_rebalance(struct lpfc_hba *phba, unsigned int cpu, bool offline)
1287312873

1287412874
if (offline) {
1287512875
/* Find next online CPU on original mask */
12876-
cpu_next = cpumask_next_wrap(cpu, orig_mask, cpu, true);
12876+
cpu_next = cpumask_next_wrap_old(cpu, orig_mask, cpu, true);
1287712877
cpu_select = lpfc_next_online_cpu(orig_mask, cpu_next);
1287812878

1287912879
/* Found a valid CPU */

include/linux/cpumask.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ unsigned int cpumask_next_and(int n, const struct cpumask *src1p,
296296

297297
#if NR_CPUS == 1
298298
static __always_inline
299-
unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap)
299+
unsigned int cpumask_next_wrap_old(int n, const struct cpumask *mask, int start, bool wrap)
300300
{
301301
cpumask_check(start);
302302
if (n != -1)
@@ -312,7 +312,7 @@ unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, boo
312312
return cpumask_first(mask);
313313
}
314314
#else
315-
unsigned int __pure cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap);
315+
unsigned int __pure cpumask_next_wrap_old(int n, const struct cpumask *mask, int start, bool wrap);
316316
#endif
317317

318318
/**

kernel/padata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static struct padata_priv *padata_find_next(struct parallel_data *pd,
290290
if (remove_object) {
291291
list_del_init(&padata->list);
292292
++pd->processed;
293-
pd->cpu = cpumask_next_wrap(cpu, pd->cpumask.pcpu, -1, false);
293+
pd->cpu = cpumask_next_wrap_old(cpu, pd->cpumask.pcpu, -1, false);
294294
}
295295

296296
spin_unlock(&reorder->lock);

lib/cpumask.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <linux/numa.h>
99

1010
/**
11-
* cpumask_next_wrap - helper to implement for_each_cpu_wrap
11+
* cpumask_next_wrap_old - helper to implement for_each_cpu_wrap
1212
* @n: the cpu prior to the place to search
1313
* @mask: the cpumask pointer
1414
* @start: the start point of the iteration
@@ -19,7 +19,7 @@
1919
* Note: the @wrap argument is required for the start condition when
2020
* we cannot assume @start is set in @mask.
2121
*/
22-
unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap)
22+
unsigned int cpumask_next_wrap_old(int n, const struct cpumask *mask, int start, bool wrap)
2323
{
2424
unsigned int next;
2525

@@ -37,7 +37,7 @@ unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, boo
3737

3838
return next;
3939
}
40-
EXPORT_SYMBOL(cpumask_next_wrap);
40+
EXPORT_SYMBOL(cpumask_next_wrap_old);
4141

4242
/* These are not inline because of header tangles. */
4343
#ifdef CONFIG_CPUMASK_OFFSTACK

0 commit comments

Comments
 (0)