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
F137199394: D35001.id105231.diff
Fri, Nov 21, 11:52 AM
Unknown Object (File)
Wed, Nov 19, 3:21 AM
Unknown Object (File)
Sun, Nov 16, 10:53 PM
Unknown Object (File)
Sun, Nov 16, 7:06 PM
Unknown Object (File)
Sat, Nov 15, 12:14 AM
Unknown Object (File)
Wed, Nov 5, 3:40 PM
Unknown Object (File)
Sat, Nov 1, 2:17 PM
Unknown Object (File)
Sat, Nov 1, 12:02 PM

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).