Page MenuHomeFreeBSD

Check for a 'pci' prefix rather than a full match in get_addr_props
ClosedPublic

Authored by jhibbits on Jun 15 2018, 3:45 AM.

Details

Summary

Newer OPAL device trees, such as those on POWER9 systems, use 'pciex' for
device_type, not 'pci'. Rather than enumerating all possible variants, just
check for a 'pci' prefix.

Diff Detail

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

Event Timeline

jhibbits created this revision.Jun 15 2018, 3:45 AM

It's mildly stupid, since the universe of pci* isn't big, but I think I would prefer a check for "pci" || "pciex" to just checking the first three characters.

jhibbits updated this revision to Diff 43813.Jun 15 2018, 2:15 PM

Change to nwhitehorn's preference. Either is fine with me.

Don't you want strcmp() == 0?

jhibbits updated this revision to Diff 43837.Jun 15 2018, 6:28 PM

I should probably caffeinate before making such trivial changes.

nwhitehorn accepted this revision.Jun 15 2018, 6:33 PM
This revision is now accepted and ready to land.Jun 15 2018, 6:33 PM
This revision was automatically updated to reflect the committed changes.