[PATCH] selftests: alsa: Start validating control names

Mark Brown broonie at kernel.org
Thu Apr 21 14:39:55 CEST 2022


On Thu, Apr 21, 2022 at 09:50:33AM +0200, Takashi Iwai wrote:
> Mark Brown wrote:

> > +		if (!strend(ctl->name, "Switch")) {
> > +			ksft_print_msg("%d.%d %s is a writeable boolean but not a Switch\n",
> > +				       ctl->card->card, ctl->elem, ctl->name);
> > +			name_ok = false;

> I'm afraid that this would hit too many when applying to the existing
> code; although the control name should be indeed with Switch suffix,
> we tend to allow without suffix for casual non-standard elements.

It wasn't looking too bad in my survey of cards I had to hand - the
writable check is there because of jacks, which does make sense since
you can't actually switch them.  Some of that is due to ASoC handling
this in the core though.

> But having the check would help for avoiding such a mistake for the
> future code, so it's fine to add this strict check, IMO.

Yeah, that's more the target here.
-------------- 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/20220421/245f69e8/attachment-0001.sig>


More information about the Alsa-devel mailing list