Commit 336843dd authored by William Lee Irwin III's avatar William Lee Irwin III Committed by Linus Torvalds

[PATCH] make topology.h macros safer

Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0f10193f
......@@ -67,7 +67,7 @@ static inline cpumask_t pcibus_to_cpumask(int bus)
}
/* Node-to-Node distance */
#define node_distance(from, to) (from != to)
#define node_distance(from, to) ((from) != (to))
/* Cross-node load balancing interval. */
#define NODE_BALANCE_RATE 100
......
......@@ -59,7 +59,7 @@ extern struct node_cpuid_s node_cpuid[NR_CPUS];
*/
extern u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES];
#define node_distance(from,to) (numa_slit[from * numnodes + to])
#define node_distance(from,to) (numa_slit[(from) * numnodes + (to)])
extern int paddr_to_nid(unsigned long paddr);
......
......@@ -55,7 +55,7 @@ static inline int __next_node_with_cpus(int node)
for (node = 0; node < numnodes; node = __next_node_with_cpus(node))
#ifndef node_distance
#define node_distance(from,to) (from != to)
#define node_distance(from,to) ((from) != (to))
#endif
#ifndef PENALTY_FOR_NODE_WITH_CPUS
#define PENALTY_FOR_NODE_WITH_CPUS (1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment