Page MenuHomeFreeBSD

Limit ofw_cpu_early_foreach to CPUs only

Authored by on Jul 27 2015, 8:02 AM.



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.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline retitled this revision from to Limit ofw_cpu_early_foreach to CPUs only. updated this object. edited the test plan for this revision. (Show Details) set the repository for this revision to rS FreeBSD src repository.
andrew edited edge metadata.Jul 27 2015, 2:51 PM

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.

300 ↗(On Diff #7370)
u_int next_id;
next_id = 0;
for (child = OF_child(node); child != 0; child = OF_peer(child), id = next_id) {
310 ↗(On Diff #7370)
319 ↗(On Diff #7370)

Then revert this

329 ↗(On Diff #7370)

And this

333 ↗(On Diff #7370)

etc. edited edge metadata. removed rS FreeBSD src repository as the repository for this revision.
andrew accepted this revision.Jul 28 2015, 8:50 AM
andrew edited edge metadata.

Just need to fix the minor style issue before committing.

301 ↗(On Diff #7424)

This line will need to be split as it was already at 80 characters.

This revision is now accepted and ready to land.Jul 28 2015, 8:50 AM
This revision was automatically updated to reflect the committed changes.