[PATCH 05/35] cpumask: remove min from first_cpu/next_cpu From: Rusty Russell <rusty@rustcorp.com.au>

From: Mike Travis
Date: Wed Oct 22 2008 - 22:10:34 EST


Seems like this has been here forever, but I can't see why:
find_first_bit and find_next_bit both return >= NR_CPUS on failure.

Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Signed-off-by: Mike Travis <travis@xxxxxxx>
---
lib/cpumask.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

--- linux-2.6.28.orig/lib/cpumask.c
+++ linux-2.6.28/lib/cpumask.c
@@ -5,13 +5,13 @@

int __first_cpu(const cpumask_t *srcp)
{
- return min_t(int, NR_CPUS, find_first_bit(srcp->bits, NR_CPUS));
+ return find_first_bit(srcp->bits, NR_CPUS);
}
EXPORT_SYMBOL(__first_cpu);

int __next_cpu(int n, const cpumask_t *srcp)
{
- return min_t(int, NR_CPUS, find_next_bit(srcp->bits, NR_CPUS, n+1));
+ return find_next_bit(srcp->bits, NR_CPUS, n+1);
}
EXPORT_SYMBOL(__next_cpu);

@@ -27,8 +27,7 @@ EXPORT_SYMBOL(cpumask_next_and);
#if NR_CPUS > 64
int __next_cpu_nr(int n, const cpumask_t *srcp)
{
- return min_t(int, nr_cpu_ids,
- find_next_bit(srcp->bits, nr_cpu_ids, n+1));
+ return find_next_bit(srcp->bits, nr_cpu_ids, n+1);
}
EXPORT_SYMBOL(__next_cpu_nr);
#endif

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/