Commit 38b93780 authored by Srivatsa S. Bhat's avatar Srivatsa S. Bhat Committed by Linus Torvalds
Browse files

lib/cpumask.c: remove __any_online_cpu()

__any_online_cpu() is not optimal and also unnecessary.  So, replace its
use by faster cpumask_* operations.
Signed-off-by: default avatarSrivatsa S. Bhat <>
Cc: Eric Dumazet <>
Cc: Venkatesh Pallipadi <>
Cc: Rusty Russell <>
Cc: KOSAKI Motohiro <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 74046494
......@@ -810,11 +810,10 @@ static inline const struct cpumask *get_cpu_mask(unsigned int cpu)
#else /* NR_CPUS > 1 */
int __first_cpu(const cpumask_t *srcp);
int __next_cpu(int n, const cpumask_t *srcp);
int __any_online_cpu(const cpumask_t *mask);
#define first_cpu(src) __first_cpu(&(src))
#define next_cpu(n, src) __next_cpu((n), &(src))
#define any_online_cpu(mask) __any_online_cpu(&(mask))
#define any_online_cpu(mask) cpumask_any_and(&mask, cpu_online_mask)
#define for_each_cpu_mask(cpu, mask) \
for ((cpu) = -1; \
(cpu) = next_cpu((cpu), (mask)), \
......@@ -26,18 +26,6 @@ int __next_cpu_nr(int n, const cpumask_t *srcp)
int __any_online_cpu(const cpumask_t *mask)
int cpu;
for_each_cpu(cpu, mask) {
if (cpu_online(cpu))
return cpu;
* cpumask_next_and - get the next cpu in *src1p & *src2p
* @n: the cpu prior to the place to search (ie. return will be > @n)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment