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

Shuah Khan skhan at linuxfoundation.org
Mon Jan 24 23:12:47 CET 2022


On 1/24/22 2:48 PM, Mark Brown wrote:
> 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.
> 

Missed that. Sounds good. In case this is going through sound tree

Reviewed-by: Shuah Khan <skhan at linuxfoundation.org>

thanks,
-- Shuah


More information about the Alsa-devel mailing list