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)
Feb 7 2024, 6:00 AM
Unknown Object (File)
Dec 20 2023, 1:26 AM
Unknown Object (File)
Dec 17 2023, 4:32 PM
Unknown Object (File)
Dec 12 2023, 2:19 AM
Unknown Object (File)
Sep 23 2023, 1:38 PM
Unknown Object (File)
Sep 6 2023, 9:04 AM
Unknown Object (File)
Aug 29 2023, 10:49 AM
Unknown Object (File)
Aug 29 2023, 10:47 AM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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