diff mbox series

[v2,4/6] kselftest/alsa: mixer-test: Skip write verification for volatile controls

Message ID 20240614153717.30143-5-tiwai@suse.de
State New
Headers show
Series ALSA: some driver fixes for control input validations | expand

Commit Message

Takashi Iwai June 14, 2024, 3:37 p.m. UTC
The control elements with volatile flag don't guarantee that the
written values are actually saved for the next reads, hence we can't
verify the written values reliably.  Skip the verification after write
tests for those volatile controls for avoiding confusion.

Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Closes: https://lore.kernel.org/r/1d44be36-9bb9-4d82-8953-5ae2a4f09405@molgen.mpg.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 tools/testing/selftests/alsa/mixer-test.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/tools/testing/selftests/alsa/mixer-test.c b/tools/testing/selftests/alsa/mixer-test.c
index 1c04e5f638a0..c98167818319 100644
--- a/tools/testing/selftests/alsa/mixer-test.c
+++ b/tools/testing/selftests/alsa/mixer-test.c
@@ -616,6 +616,10 @@  static int write_and_verify(struct ctl_data *ctl,
 	if (!snd_ctl_elem_info_is_readable(ctl->info))
 		return err;
 
+	/* Skip the verification for volatile controls, too */
+	if (snd_ctl_elem_info_is_volatile(ctl->info))
+		return err;
+
 	snd_ctl_elem_value_set_id(read_val, ctl->id);
 
 	err = snd_ctl_elem_read(ctl->card->handle, read_val);