All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bad definition of cpus_complement
@ 2003-08-28 15:54 Joe Korty
  2003-08-28 18:18 ` Mikael Pettersson
  2003-08-28 18:32 ` William Lee Irwin III
  0 siblings, 2 replies; 3+ messages in thread
From: Joe Korty @ 2003-08-28 15:54 UTC (permalink / raw)
  To: akpm; +Cc: torvalds, linux-kernel

One of the definitions of cpus_complement is broke.  Also, cpus_complement is
the only cpus_* definition which operates in-place rather than in (dst,src)
form.  I will submit a patch to convert if there is interest.

Joe

--- include/asm-generic/cpumask_up.h.orig	2003-08-27 06:08:38.000000000 -0400
+++ include/asm-generic/cpumask_up.h	2003-08-28 11:45:09.000000000 -0400
@@ -28,7 +28,7 @@
 
 #define cpus_complement(map)						\
 	do {								\
-		cpus_coerce(map) = !cpus_coerce(map);			\
+		cpus_coerce(map) = ~cpus_coerce(map);			\
 	} while (0)
 
 #define cpus_equal(map1, map2)		(cpus_coerce(map1) == cpus_coerce(map2))


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bad definition of cpus_complement
  2003-08-28 15:54 [PATCH] bad definition of cpus_complement Joe Korty
@ 2003-08-28 18:18 ` Mikael Pettersson
  2003-08-28 18:32 ` William Lee Irwin III
  1 sibling, 0 replies; 3+ messages in thread
From: Mikael Pettersson @ 2003-08-28 18:18 UTC (permalink / raw)
  To: joe.korty; +Cc: akpm, linux-kernel

Joe Korty writes:
 > One of the definitions of cpus_complement is broke.  Also, cpus_complement is
 > the only cpus_* definition which operates in-place rather than in (dst,src)
 > form.  I will submit a patch to convert if there is interest.
 > 
 > Joe
 > 
 > --- include/asm-generic/cpumask_up.h.orig	2003-08-27 06:08:38.000000000 -0400
 > +++ include/asm-generic/cpumask_up.h	2003-08-28 11:45:09.000000000 -0400
 > @@ -28,7 +28,7 @@
 >  
 >  #define cpus_complement(map)						\
 >  	do {								\
 > -		cpus_coerce(map) = !cpus_coerce(map);			\
 > +		cpus_coerce(map) = ~cpus_coerce(map);			\
 >  	} while (0)

Broken how? The value range for a cpumask_t on UP is [0,1],
and ! respects that whereas ~ does not.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bad definition of cpus_complement
  2003-08-28 15:54 [PATCH] bad definition of cpus_complement Joe Korty
  2003-08-28 18:18 ` Mikael Pettersson
@ 2003-08-28 18:32 ` William Lee Irwin III
  1 sibling, 0 replies; 3+ messages in thread
From: William Lee Irwin III @ 2003-08-28 18:32 UTC (permalink / raw)
  To: Joe Korty; +Cc: akpm, torvalds, linux-kernel

On Thu, Aug 28, 2003 at 11:54:52AM -0400, Joe Korty wrote:
> One of the definitions of cpus_complement is broke.  Also, cpus_complement is
> the only cpus_* definition which operates in-place rather than in (dst,src)
> form.  I will submit a patch to convert if there is interest.

The definition is fine (see other responses), but the inconsistent
argument convention might be worth shoring up to match the others.


-- wli

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-08-28 18:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-28 15:54 [PATCH] bad definition of cpus_complement Joe Korty
2003-08-28 18:18 ` Mikael Pettersson
2003-08-28 18:32 ` William Lee Irwin III

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.