lkml.org 
[lkml]   [2004]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH][2.6] first/next_cpu returns values > NR_CPUS
From
Date
On Sun, 2004-08-01 at 06:41, William Lee Irwin III wrote:
> No problem.
>
>
> Index: hotplug-2.6.8-rc2/include/linux/cpumask.h
> ===================================================================
> --- hotplug-2.6.8-rc2.orig/include/linux/cpumask.h 2004-07-29 04:44:59.000000000 -0700
> +++ hotplug-2.6.8-rc2/include/linux/cpumask.h 2004-08-01 06:32:31.615472016 -0700
> @@ -207,13 +207,13 @@
> #define first_cpu(src) __first_cpu(&(src), NR_CPUS)
> static inline int __first_cpu(const cpumask_t *srcp, int nbits)
> {
> - return find_first_bit(srcp->bits, nbits);
> + return min_t(int, nbits, find_first_bit(srcp->bits, nbits));
> }
>
> #define next_cpu(n, src) __next_cpu((n), &(src), NR_CPUS)
> static inline int __next_cpu(int n, const cpumask_t *srcp, int nbits)
> {
> - return find_next_bit(srcp->bits, nbits, n+1);
> + return min_t(int, nbits, find_next_bit(srcp->bits, nbits, n+1));
> }
>
> #define cpumask_of_cpu(cpu) \

I'll add the nodemask.h fix here, too.

-Matt

--- linux-2.6.8-rc2-mm1/include/linux/nodemask.h 2004-07-28 10:50:51.000000000 -0700
+++ linux-2.6.8-rc2-mm1/include/linux/nodemask.h.fixed 2004-08-02 14:56:12.000000000 -0700
@@ -216,13 +216,13 @@ static inline void __nodes_shift_left(no
#define first_node(src) __first_node(&(src), MAX_NUMNODES)
static inline int __first_node(const nodemask_t *srcp, int nbits)
{
- return find_first_bit(srcp->bits, nbits);
+ return min_t(int, nbits, find_first_bit(srcp->bits, nbits));
}

#define next_node(n, src) __next_node((n), &(src), MAX_NUMNODES)
static inline int __next_node(int n, const nodemask_t *srcp, int nbits)
{
- return find_next_bit(srcp->bits, nbits, n+1);
+ return min_t(int, nbits, find_next_bit(srcp->bits, nbits, n+1));
}

#define nodemask_of_node(node) \

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

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.108 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site