[PATCH] kselftest: alsa: Add test case for writing invalid values

Mark Brown broonie at kernel.org
Mon Jan 24 22:48:12 CET 2022


On Mon, Jan 24, 2022 at 02:35:53PM -0700, Shuah Khan wrote:
> On 1/24/22 8:14 AM, Mark Brown wrote:

> > +	/* Restore the default value to minimise disruption */
> > +	err = write_and_verify(ctl, ctl->def_val, NULL);

> Why not read the value and then restore the value, in case the value
> before the write test is different from the ctl->def_val?

That's what we're doing - def_val is the value read from the device at
the start of the test program before it tries to do any writes, we then
restore it at the end of every test to minimise the chances that the
device configuration will be messed up if the test program falls over.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20220124/1e98b284/attachment.sig>


More information about the Alsa-devel mailing list