Page MenuHomeFreeBSD

sound: Simplify chn_init()
ClosedPublic

Authored by christos on Jul 17 2024, 12:42 AM.
Tags
None
Referenced Files
F103045273: D45985.diff
Wed, Nov 20, 5:25 AM
Unknown Object (File)
Thu, Nov 7, 2:34 AM
Unknown Object (File)
Wed, Nov 6, 1:06 PM
Unknown Object (File)
Wed, Nov 6, 11:00 AM
Unknown Object (File)
Tue, Nov 5, 6:13 PM
Unknown Object (File)
Tue, Nov 5, 1:05 PM
Unknown Object (File)
Oct 21 2024, 4:24 AM
Unknown Object (File)
Oct 16 2024, 4:52 AM
Subscribers

Details

Summary
  • Remove unnecessary CHN_[UN]LOCKs.
  • Improve device_printf() messages.
  • Remove redundant checks.
  • Remove 0 assignments, since the channel is allocated with M_ZERO.
  • Re-organize sections in a more coherent way.
  • Remove "out1" label, just return NULL directly.
  • Rename "out2" to "fail" and simplify logic.
  • Do not check the return value of dsp_unit2name(), as it is guaranteed not to fail (we pass a valid channel type).

Sponsored by: The FreeBSD Foundation
MFC after: 2 days

Diff Detail

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

Event Timeline

This is hard to review. I can't see any problems, but there are lots of things mixed in so it's hard to be confident. If you are happy with the change, I think you should just go ahead.

Don't see anything suspicious, no regressions in my (brief) tests.

This revision is now accepted and ready to land.Jul 22 2024, 12:40 AM
This revision was automatically updated to reflect the committed changes.