Page MenuHomeFreeBSD

sound: Remove macro magic from pcm/feeder_matrix.c
Needs ReviewPublic

Authored by christos on Dec 11 2024, 4:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jan 22, 4:53 PM
Unknown Object (File)
Fri, Jan 10, 10:23 AM
Unknown Object (File)
Thu, Jan 9, 11:36 PM
Unknown Object (File)
Thu, Jan 9, 11:13 AM
Unknown Object (File)
Thu, Jan 9, 10:13 AM
Unknown Object (File)
Thu, Jan 9, 10:00 AM
Unknown Object (File)
Wed, Jan 8, 8:20 PM
Unknown Object (File)
Dec 26 2024, 2:26 PM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 61692
Build 58576: arc lint + arc unit

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.