HomeFreeBSD

sound tests: Fix downshift calculation in pcm_read_write test

Description

sound tests: Fix downshift calculation in pcm_read_write test

In some situations the feeders in the sound module lower the pcm sample
resolution through a downshift of the sample value. The pcm_read_write
test implements this operation with an arithmetic division to avoid
implementation defined or architecture specific behavior. Due to
different rounding, the test produced marginally different sample
values, which made the test fail on 32 bit architectures. Correct this.

Reported by: CI
Fixes: 27ef5d48c729 ("sound: Unit test the pcm sample read and write macros")
MFC after: 1 week
Reviewed by: christos, markj
Differential revision: https://reviews.freebsd.org/D48926

(cherry picked from commit 6672831bda883756d7f4598bb4b119f99eb1e7d2)

Details

Provenance
dev_submerge.chAuthored on Feb 18 2025, 7:35 PM
christosCommitted on Feb 25 2025, 12:17 PM
Reviewer
christos
Differential Revision
D48926: sound tests: Fix downshift calculation in pcm_read_write test
Parents
rG999e714432ac: snd_hda: Fix typo (s/owerflow/overflow)
Branches
Unknown
Tags
Unknown