Hi, everybody:
If some "memory" node contains "numa-node-id", but some others missed. Can we simply ignored it?
I think we should break out too, and faking to only have node0.
else if (r)
/* some other error */
break;
r = of_address_to_resource(np, 0, &rsrc);
for (i = 0; !r; i++, r = of_address_to_resource(np, i,
But r(non-zero) is just break this loop, the original is break the outer for (;;) loop
How about as below?
for_each_node_by_type(np, "memory") {
... ...
for (i = 0; !of_address_to_resource(np, i, &rsrc); i++) {
r = numa_add_memblk(nid, rsrc.start,
rsrc.end - rsrc.start + 1);
if (r)
goto finished;
}
if (!i)
pr_err("NUMA: bad reg property in memory node\n");
}
finished:
&rsrc)) {
r = numa_add_memblk(nid, rsrc.start,
rsrc.end - rsrc.start + 1);
}
}
of_node_put(np);
return r;
Perhaps with a "if (!i && r) pr_err()" for an error message at the end.
Rob
.