bad definition of cpus_complement
PATCH 1/1 bad definition of cpus_complement
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
asm-generic/cpumask_up.h renamed from asm-generic/cpumask_up.h.orig +1 -1
@@ -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))
Quoted 9 lines · Joe Korty
One of the definitions of
cpus_complementis broke. Also,cpus_complementis 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
asm-generic/cpumask_up.h line 32
Quoted 6 lines
asm-generic/cpumask_up.h renamed from asm-generic/cpumask_up.h.orig +1
-1@@ -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.
Quoted 3 lines · Joe Korty
One of the definitions of
cpus_complementis broke. Also,cpus_complementis 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