Commit 2e036bd1 authored by Olof Johansson's avatar Olof Johansson Committed by Linus Torvalds

[PATCH] ppc64: fix CPU numa init code thinkos

There seems to have been a couple of thinkos in the NUMA init code, in
particular in find_cpu_node():

* Property size returned is in bytes, not words
* Off-by-one error in loop iteration
Signed-off-by: default avatarNathan Lynch <nathanl@austin.ibm.com>
Signed-off-by: default avatarOlof Johansson <olof@austin.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2a0e92f4
......@@ -76,9 +76,11 @@ static struct device_node * __init find_cpu_node(unsigned int cpu)
interrupt_server = (unsigned int *)get_property(cpu_node,
"ibm,ppc-interrupt-server#s", &len);
len = len / sizeof(u32);
if (interrupt_server && (len > 0)) {
while (len--) {
if (interrupt_server[len-1] == hw_cpuid)
if (interrupt_server[len] == hw_cpuid)
return cpu_node;
}
} else {
......
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