diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-10-27 11:03:22 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-10-27 11:03:22 +1100 |
commit | 656f7a39e30b4011fdf8da4a795288b93d89b92c (patch) | |
tree | 1adc8faf5dda54ff59f644ddffa77d694d5f1de0 /lib | |
parent | 8a7f08122937d9fb4ba911a8b03b7eab85abedcb (diff) |
cpumask:use-nr_cpu_ids-in-all-ops
nr_cpu_ids is the (badly named) runtime limit on possible CPU numbers;
ie. the variable version of NR_CPUS.
If we use this in *all* the cpu ops it simplifies the API, and will
be possible to allocate cpumasks of the minimal length at runtime.
From: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cpumask.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/cpumask.c b/lib/cpumask.c index d131e5fed1ae..71071058fa27 100644 --- a/lib/cpumask.c +++ b/lib/cpumask.c @@ -5,33 +5,25 @@ int __first_cpu(const cpumask_t *srcp) { - return find_first_bit(srcp->bits, NR_CPUS); + return find_first_bit(srcp->bits, nr_cpumask_bits); } EXPORT_SYMBOL(__first_cpu); int __next_cpu(int n, const cpumask_t *srcp) { - return find_next_bit(srcp->bits, NR_CPUS, n+1); + return find_next_bit(srcp->bits, nr_cpumask_bits, n+1); } EXPORT_SYMBOL(__next_cpu); int cpumask_next_and(int n, const cpumask_t *srcp, const cpumask_t *andp) { - while ((n = next_cpu_nr(n, *srcp)) < nr_cpu_ids) + while ((n = next_cpu(n, *srcp)) < nr_cpu_ids) if (cpumask_test_cpu(n, andp)) break; return n; } EXPORT_SYMBOL(cpumask_next_and); -#if NR_CPUS > 64 -int __next_cpu_nr(int n, const cpumask_t *srcp) -{ - return find_next_bit(srcp->bits, nr_cpu_ids, n+1); -} -EXPORT_SYMBOL(__next_cpu_nr); -#endif - int __any_online_cpu(const cpumask_t *mask) { int cpu; |