Re: (resend-2) take3: Updated CPU Hotplug patches for IA64 (pjblessed) Patch [6/7]

From: Andrew Morton
Date: Thu May 06 2004 - 01:16:19 EST


Ashok Raj <ashok.raj@xxxxxxxxx> wrote:
>
> Name: cpu_present_map.patch

Ho-hum. Please at least compile-test non-trivial patches with
CONFIG_SMP=n, especially when they dink with bitmasks, bitmaps and
SMP-specific features.

init/main.c: In function `fixup_cpu_present_map':
init/main.c:636: warning: use of compound expressions as lvalues is deprecated
init/main.c:636: error: invalid lvalue in assignment

Due to:

cpu_set(i, cpu_present_map);

It appears that cpu_set() is simply broken on UP:


#define cpu_present_map cpumask_of_cpu(0)

#define cpumask_of_cpu(cpu) ({ ((cpumask_t)1) << (cpu); })

#define cpu_set(cpu, map) do { (void)(cpu); cpus_coerce(map) = 1UL; } while (0)

Put those things together and there's no way it can work. It's not even
conceptually right: cpu_present_map is a "constant" on UP and we have no
business trying to modify it. So perhaps a build error is the appropriate
response.

I'll stick a CONFIG_SMP in the caller, let the bitmap beavers worry about
the more general details.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/