On some platforms, the /cpus entry contains cpu-to-cluster
map which deffinitely is not a CPU device. Its presence was
causing incrementing of "id" variable and reporting more
CPUs available than it should.
To make "id" valid, increment it only when an entry really
is a CPU.
Details
Details
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
I'm not sure we need a goto in the loop, finding the next id is simple to do when we know we have a cpu node.
| sys/dev/ofw/ofw_cpu.c | ||
|---|---|---|
| 301–314 | u_int next_id;
...
next_id = 0;
...
for (child = OF_child(node); child != 0; child = OF_peer(child), id = next_id) { | |
| 311 | next_id++; | |
| 324 | Then revert this | |
| 332 | And this | |
| 336 | etc. | |
Comment Actions
Just need to fix the minor style issue before committing.
| sys/dev/ofw/ofw_cpu.c | ||
|---|---|---|
| 301 | This line will need to be split as it was already at 80 characters. | |