[PATCH 03/31] cpumask: remove min from first_cpu/next_cpu

Previous thread: [PATCH 06/31] cpumask: new lib/cpumask.c by Mike Travis on Monday, September 29, 2008 - 11:02 am. (1 message)

Next thread: [PATCH 01/31] cpumask: Documentation by Mike Travis on Monday, September 29, 2008 - 11:02 am. (8 messages)
From: Mike Travis
Date: Monday, September 29, 2008 - 11:02 am

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@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>

---
 lib/cpumask.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- masklongs.orig/lib/cpumask.c
+++ masklongs/lib/cpumask.c
@@ -5,21 +5,20 @@
 
 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);
 
 #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

-- 
--

Previous thread: [PATCH 06/31] cpumask: new lib/cpumask.c by Mike Travis on Monday, September 29, 2008 - 11:02 am. (1 message)

Next thread: [PATCH 01/31] cpumask: Documentation by Mike Travis on Monday, September 29, 2008 - 11:02 am. (8 messages)