[PATCH] [PPC64] Fix CPU numa init code thinkos
Olof Johansson
olof at austin.ibm.com
Tue Oct 19 05:40:27 EST 2004
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: Nathan Lynch <nathanl at austin.ibm.com>
Signed-off-by: Olof Johansson <olof at austin.ibm.com>
---
linux-2.5-olof/arch/ppc64/mm/numa.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
diff -puN arch/ppc64/mm/numa.c~find-cpu-node arch/ppc64/mm/numa.c
--- linux-2.5/arch/ppc64/mm/numa.c~find-cpu-node 2004-10-18 14:21:55.603312384 -0500
+++ linux-2.5-olof/arch/ppc64/mm/numa.c 2004-10-18 14:22:19.271552232 -0500
@@ -75,9 +75,11 @@ static struct device_node * __init find_
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 {
_
More information about the Linuxppc64-dev
mailing list