Page MenuHomeFreeBSD

sound: Retire the version constants
AcceptedPublic

Authored by christos on Mon, Sep 21, 12:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 22, 9:24 AM
Unknown Object (File)
Mon, Sep 21, 11:05 PM
Unknown Object (File)
Mon, Sep 21, 9:58 PM
Unknown Object (File)
Mon, Sep 21, 8:22 PM
Unknown Object (File)
Mon, Sep 21, 2:21 PM
Subscribers

Details

Summary

They exist only to fill in MODULE_DEPEND() and MODULE_VERSION(), and
every consumer passed the same value for all three, so the version
range never did anything. Use 1, like the rest of the tree does.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77135
Build 74018: arc lint + arc unit

Event Timeline

christos retitled this revision from sound: Retire the SOUND_*VER macros to sound: Retire the version constants.
sys/dev/sound/pcm/sound.c
745

I guess this could be an issue if folks have out-of-tree modules.

sys/dev/sound/pcm/sound.c
745

Theoretically yes, but I haven't found any out-of-tree driver which depends on sound(4)'s versioning, so if there is any that I missed, I think it's worth just doing a rebuild. sound(4) versions have been unmaintained for long and there is no use for them.

This revision is now accepted and ready to land.Mon, Sep 21, 6:23 PM

I've brought this up before, but I do maintain an out-of-tree sound driver (multimedia/cx88) that happens to use these version constants; for all I know I may be the only person who still uses it at this point, but I'm the maintainer so that's what matters.
I also don't think it's safe to assume there aren't other such drivers (ISTR there was at least one other one that was related to some graphics kmod).

"Just rebuilding" isn't a viable option for an out-of-tree driver here: You're changing the required version from 5 to 1, so any out-of-tree driver that wants to support multiple FreeBSD versions won't have a clean way to determine which of those versions to use to avoid kmod dependency check failures. The driver could use #ifdef SOUND_MODVER and hardcode 1 otherwise, but that strikes me as a hack. Otherwise, you'd need to bump FreeBSD_version and let drivers check that, but if anything that seems even uglier.

I really don't see why this change is necessary: you're saving a total of 6 lines in sound.h, and those 6 lines don't seem very likely to cause any ongoing maintenance burden. In exchange for that you're causing churn in all in-tree audio drivers and risking breakage of out-of-tree drivers.