linux/tools/testing/selftests/alsa
HyeongJun An 8efd5f623c selftests/alsa: Fix the step check for INTEGER controls
The modulo sits inside the subtraction, so the check evaluates
int_val - (min % step) rather than (int_val - min) % step. The
INTEGER64 branch below it is parenthesised correctly.

The written form passes only when the value equals min % step, and such
a value is always on a step boundary, so it never misses a real
violation. It only reports valid values as invalid.

snd-aloop declares step 1 on four controls, so every non-zero value on
them is reported. Before:

  # PCM Rate Shift 100000.0 value 100000 invalid for step 1 minimum 80000
  # Totals: pass:660 fail:101 xfail:0 xpass:0 skip:296 error:0

After, same card, nothing else changed:

  # Totals: pass:740 fail:21 xfail:0 xpass:0 skip:296 error:0

Eighteen files under sound/ declare a non-zero step.

Fixes: 5aaf9efffc ("kselftest: alsa: Add simplistic test for ALSA mixer controls kselftest")
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Assisted-by: Claude:claude-opus-5
Link: https://patch.msgid.link/20260903123832.97377-1-sammiee5311@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-09-03 18:07:41 +02:00
..
conf.d kselftest/alsa: pcm - move more configuration to configuration files 2023-01-02 15:07:35 +01:00
.gitignore selftests/alsa: Add a few missing gitignore files 2024-11-24 10:31:13 +01:00
alsa-local.h kselftest/alsa: pcm-test: Report cards declared in config but missing 2023-09-20 18:10:50 +02:00
conf.c Significant patch series in this pull request: 2025-12-06 14:01:20 -08:00
global-timer.c selftests: ALSA: Cover userspace-driven timers with test 2024-08-18 09:55:55 +02:00
Makefile selftests/alsa: Fix circular dependency involving global-timer 2024-12-20 10:00:41 +01:00
mixer-test.c selftests/alsa: Fix the step check for INTEGER controls 2026-09-03 18:07:41 +02:00
pcm-test.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
pcm-test.conf kselftest/alsa: pcm - Add more coverage by default 2023-01-02 15:08:24 +01:00
test-pcmtest-driver.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
utimer-test.c selftests: ALSA: Skip utimer test when CONFIG_SND_UTIMER is not enabled 2026-03-27 14:40:18 +01:00