Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpumask: drop cpumask_next_wrap_old()

Now that we have cpumask_next_wrap() wired to generic find_next_bit_wrap(),
the old implementation is not needed.

Signed-off-by: Yury Norov <yury.norov@gmail.com>

-53
-21
include/linux/cpumask.h
··· 332 332 #define for_each_cpu(cpu, mask) \ 333 333 for_each_set_bit(cpu, cpumask_bits(mask), small_cpumask_bits) 334 334 335 - #if NR_CPUS == 1 336 - static __always_inline 337 - unsigned int cpumask_next_wrap_old(int n, const struct cpumask *mask, int start, bool wrap) 338 - { 339 - cpumask_check(start); 340 - if (n != -1) 341 - cpumask_check(n); 342 - 343 - /* 344 - * Return the first available CPU when wrapping, or when starting before cpu0, 345 - * since there is only one valid option. 346 - */ 347 - if (wrap && n >= 0) 348 - return nr_cpumask_bits; 349 - 350 - return cpumask_first(mask); 351 - } 352 - #else 353 - unsigned int __pure cpumask_next_wrap_old(int n, const struct cpumask *mask, int start, bool wrap); 354 - #endif 355 - 356 335 /** 357 336 * for_each_cpu_wrap - iterate over every cpu in a mask, starting at a specified location 358 337 * @cpu: the (optionally unsigned) integer iterator
-32
lib/cpumask.c
··· 7 7 #include <linux/memblock.h> 8 8 #include <linux/numa.h> 9 9 10 - /** 11 - * cpumask_next_wrap_old - helper to implement for_each_cpu_wrap 12 - * @n: the cpu prior to the place to search 13 - * @mask: the cpumask pointer 14 - * @start: the start point of the iteration 15 - * @wrap: assume @n crossing @start terminates the iteration 16 - * 17 - * Return: >= nr_cpu_ids on completion 18 - * 19 - * Note: the @wrap argument is required for the start condition when 20 - * we cannot assume @start is set in @mask. 21 - */ 22 - unsigned int cpumask_next_wrap_old(int n, const struct cpumask *mask, int start, bool wrap) 23 - { 24 - unsigned int next; 25 - 26 - again: 27 - next = cpumask_next(n, mask); 28 - 29 - if (wrap && n < start && next >= start) { 30 - return nr_cpumask_bits; 31 - 32 - } else if (next >= nr_cpumask_bits) { 33 - wrap = true; 34 - n = -1; 35 - goto again; 36 - } 37 - 38 - return next; 39 - } 40 - EXPORT_SYMBOL(cpumask_next_wrap_old); 41 - 42 10 /* These are not inline because of header tangles. */ 43 11 #ifdef CONFIG_CPUMASK_OFFSTACK 44 12 /**