Messages in this thread | | | Date | Tue, 8 Jul 2008 19:35:56 +0200 | From | "Vegard Nossum" <> | Subject | Re: [PATCH 1/1] x86: Change _node_to_cpumask_ptr to return const ptr |
| |
Hi,
On Tue, Jul 8, 2008 at 7:06 PM, Mike Travis <travis@sgi.com> wrote: >> (v3 is applied already so Mike please send a delta to v3.) >> >> Ingo > > Subject: [PATCH 1/1] x86: Change _node_to_cpumask_ptr to return const ptr > > * Strengthen the return type for the _node_to_cpumask_ptr to be > a const pointer. This adds compiler checking to insure that > node_to_cpumask_map[] is not changed inadvertently. > > Applies to tip/master with the following patch applied: > > "[PATCH 1/1] x86: Add check for node passed to node_to_cpumask V3" > > Signed-off-by: Mike Travis <travis@sgi.com> > --- > Note: I did not change node_to_cpumask_ptr() in include/asm-generic/topology.h > as node_to_cpumask_ptr_next() does change the cpumask value.
Hmmm. Does it really?
#define node_to_cpumask_ptr_next(v, node) \ _##v = node_to_cpumask(node)
This doesn't seem to modify it?
Also, isn't it unfortunate to have the same function return const/non-const depending on your arch/config?
Vegard
-- "The animistic metaphor of the bug that maliciously sneaked in while the programmer was not looking is intellectually dishonest as it disguises that the error is the programmer's own creation." -- E. W. Dijkstra, EWD1036
| |