Page MenuHomeFreeBSD

sound: Remove macro magic from pcm/feeder_matrix.c
ClosedPublic

Authored by christos on Dec 11 2024, 4:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 10, 11:14 PM
Unknown Object (File)
Wed, Feb 26, 11:06 PM
Unknown Object (File)
Feb 14 2025, 5:02 PM
Unknown Object (File)
Feb 13 2025, 5:57 AM
Unknown Object (File)
Feb 10 2025, 11:33 PM
Unknown Object (File)
Feb 8 2025, 4:00 PM
Unknown Object (File)
Feb 8 2025, 3:15 AM
Unknown Object (File)
Feb 8 2025, 2:16 AM
Subscribers

Details

Summary

Turn the FEEDMATRIX_DECLARE macro into a single inline function
(feed_matrix_apply()). There is no reason to have this as a macro, it
only complicated the code. An advantage of this patch is that, because
we no longer call the functions created by the macro through function
pointers (apply field of feed_matrix_info), we can call
feed_matrix_apply() directly in feed_matrix_feed().

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Diff Detail

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

Event Timeline

Same as D48032, you may want to call your function with literal format parameters, for performance reasons.

sys/dev/sound/pcm/feeder_matrix.c
435

Why can't this entire switch statement just be feed_matrix_apply(info, src, dst, j, info->fmt);?

sys/dev/sound/pcm/feeder_matrix.c
435

There is related discussion in D48032

Mark fmt argument as const.

Clamp accum, not v, as in the original code.

This revision was not accepted when it landed; it landed in state Needs Review.Mon, Mar 10, 8:22 PM
This revision was automatically updated to reflect the committed changes.