[PATCH v7 1/1] alsa: jack: implement software jack injection via debugfs
Takashi Iwai
tiwai at suse.de
Tue Jan 26 07:58:08 CET 2021
On Tue, 26 Jan 2021 07:55:29 +0100,
Hui Wang wrote:
>
>
> On 1/25/21 10:32 PM, Takashi Iwai wrote:
> > On Mon, 25 Jan 2021 04:21:18 +0100,
> > Hui Wang wrote:
> >> This change adds audio jack injection feature through debugfs, with
> >> this feature, we could validate alsa userspace changes by injecting
> >> plugin or plugout events to the non-phantom audio jacks.
> >>
> >> With this change, the sound core will build the folders
> >> $debugfs_mount_dir/sound/cardN if SND_DEBUG and DEBUG_FS are enabled.
> <snip>
> >> + return -ENOMEM;
> >> +
> >> + /* replace the chars which are not suitable for folder's name with _ */
> >> + for (i = 0; i < strlen(tname); i++)
> > No need to use strlen(), just check the NUL character on tname[i].
> OK, will change it to: for (i = 0; tname[i] != '\0'; i++)
Even the "!= '\0" part can be dropped, too :)
for (i = 0; tname[i]; i++)
....
Takashi
More information about the Alsa-devel
mailing list