mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Dobson <colpatch@us.ibm.com>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: Paul Jackson <pj@sgi.com>,
	zwane@linuxpower.ca, LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH][2.6] first/next_cpu returns values > NR_CPUS
Date: Mon, 02 Aug 2004 15:00:33 -0700	[thread overview]
Message-ID: <1091484032.4415.55.camel@arrakis> (raw)
In-Reply-To: <20040801134112.GU2334@holomorphy.com>

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)						\



  parent reply	other threads:[~2004-08-02 22:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-31 20:52 Zwane Mwaikambo
2004-07-31 20:57 ` William Lee Irwin III
2004-07-31 23:02   ` Zwane Mwaikambo
2004-08-01  6:21 ` Paul Jackson
2004-08-01  7:22   ` Zwane Mwaikambo
2004-08-01 11:20     ` Paul Jackson
2004-08-01 14:51       ` Zwane Mwaikambo
2004-08-01 12:40     ` William Lee Irwin III
2004-08-01 13:05       ` Paul Jackson
2004-08-01 13:10         ` William Lee Irwin III
2004-08-01 13:36           ` Paul Jackson
2004-08-01 13:41             ` William Lee Irwin III
2004-08-01 13:47               ` Paul Jackson
2004-08-02 22:00               ` Matthew Dobson [this message]
2004-08-05 16:50                 ` OGAWA Hirofumi
2004-08-05 17:01                   ` William Lee Irwin III
2004-08-05 17:42                   ` Andrew Morton
2004-08-05 18:13                     ` Roman Zippel
2004-08-01 14:54       ` Zwane Mwaikambo
2004-08-01 15:05         ` William Lee Irwin III

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1091484032.4415.55.camel@arrakis \
    --to=colpatch@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.com \
    --cc=wli@holomorphy.com \
    --cc=zwane@linuxpower.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome