Page MenuHomeFreeBSD

xen: Use devclass_find to lookup devclasses in identify.
ClosedPublic

Authored by jhb on Apr 20 2022, 8:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 10, 8:34 AM
Unknown Object (File)
Thu, Dec 5, 9:47 PM
Unknown Object (File)
Thu, Dec 5, 7:50 PM
Unknown Object (File)
Tue, Nov 26, 10:54 AM
Unknown Object (File)
Oct 16 2024, 7:55 PM
Unknown Object (File)
Oct 9 2024, 2:36 AM
Unknown Object (File)
Oct 9 2024, 2:36 AM
Unknown Object (File)
Oct 9 2024, 2:35 AM

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45324
Build 42212: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Apr 20 2022, 8:14 PM
This revision is now accepted and ready to land.Apr 20 2022, 9:21 PM

aarch64 kernel build continued to pass with this in place. This hasn't been tested in execution, but I'm under the impression devclass_find() is MI so low risk.

Hm, isn't this more fragile, as we need to keep the string in driver_t in sync with the call to devclass_find()?

With the current approach there's no need for that, and any change to the naming of the _devclass variable will cause a compiler error.

I'm axing the devclass argument to DRIVER_MODULE since it is unused the vast majority of the time. If you'd rather not hardcode the string we could instead use driver->name instead of the hardcoded string.

Note however that we hardcode the driver name a few lines below in the call to BUS_ADD_CHILD, so if we are really worried about that then we need to change BUS_ADD_CHILD to also use driver->name.

In D35001#793469, @jhb wrote:

I'm axing the devclass argument to DRIVER_MODULE since it is unused the vast majority of the time. If you'd rather not hardcode the string we could instead use driver->name instead of the hardcoded string.

Note however that we hardcode the driver name a few lines below in the call to BUS_ADD_CHILD, so if we are really worried about that then we need to change BUS_ADD_CHILD to also use driver->name.

Indeed. I would be fine if you take the opportunity to also fix those to use driver->name while doing the change. Thanks!

This revision now requires review to proceed.Apr 22 2022, 11:31 PM
This revision is now accepted and ready to land.Apr 23 2022, 6:20 AM

Not too surprising, but this continues to pass my build tests so this is likely okay (royger is the key reviewer here).