[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <871pnsb5qp.wl-tiwai@suse.de>
Date: Sat, 27 Sep 2025 11:32:30 +0200
From: Takashi Iwai <tiwai@...e.de>
To: cryolitia@...ontech.com
Cc: Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Jonathan Corbet <corbet@....net>,
Mingcong Bai <jeffbai@...c.io>,
Kexy Biscuit <kexybiscuit@...c.io>,
Nie Cheng <niecheng1@...ontech.com>,
Zhan Jun <zhanjun@...ontech.com>,
Feng Yuan <fengyuan@...ontech.com>,
qaqland <anguoli@...ontech.com>,
kernel@...ontech.com,
linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org,
Takashi Iwai <tiwai@...e.de>
Subject: Re: [PATCH v5 3/4] ALSA: usb-audio: make param quirk_flags change-able in runtime
On Thu, 25 Sep 2025 11:25:18 +0200,
Cryolitia PukNgae via B4 Relay wrote:
>
> +/* protects quirk_flags */
> +DEFINE_MUTEX(quirk_flags_mutex);
This can be static?
> +static int param_set_quirkp(const char *val,
> + const struct kernel_param *kp)
> +{
> + guard(mutex)(&quirk_flags_mutex);
> + return param_set_charp(val, kp);
> +}
> +
> +static const struct kernel_param_ops param_ops_quirkp = {
> + .set = param_set_quirkp,
> + .get = param_get_charp,
> + .free = param_free_charp,
> +};
> +
> +#define param_check_quirkp param_check_charp
> +
> +module_param_array(quirk_flags, quirkp, NULL, 0644);
> +MODULE_PARM_DESC(quirk_flags, "Add/modify USB audio quirks");
> +
> /*
> * we keep the snd_usb_audio_t instances by ourselves for merging
> * the all interfaces on the same card as one sound device.
> @@ -697,15 +716,13 @@ static void snd_usb_init_quirk_flags(int idx, struct snd_usb_audio *chip)
> char *val;
> size_t i;
>
> + mutex_lock(&quirk_flags_mutexn);
Use guard(). Then you can avoid ugly goto.
thanks,
Takashi
Powered by blists - more mailing lists