lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5b5d06b8-8ada-49dd-a9c5-477258a9a72a@linux.intel.com>
Date: Thu, 1 Aug 2024 10:46:24 +0200
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: Wesley Cheng <quic_wcheng@...cinc.com>, srinivas.kandagatla@...aro.org,
 mathias.nyman@...el.com, perex@...ex.cz, conor+dt@...nel.org,
 corbet@....net, broonie@...nel.org, lgirdwood@...il.com, krzk+dt@...nel.org,
 Thinh.Nguyen@...opsys.com, bgoswami@...cinc.com, tiwai@...e.com,
 gregkh@...uxfoundation.org, robh@...nel.org
Cc: linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
 linux-sound@...r.kernel.org, linux-usb@...r.kernel.org,
 linux-arm-msm@...r.kernel.org, linux-doc@...r.kernel.org,
 alsa-devel@...a-project.org
Subject: Re: [PATCH v24 19/34] ASoC: qcom: qdsp6: Fetch USB offload mapped
 card and PCM device



> +static int q6usb_get_offload_dev(struct snd_soc_component *component,
> +				 int card, int pcm, enum snd_soc_usb_kctl route)
> +{
> +	struct q6usb_port_data *data = dev_get_drvdata(component->dev);
> +	struct snd_soc_usb_device *sdev;
> +	int ret = -1;
> +
> +	mutex_lock(&data->mutex);
> +
> +	if (list_empty(&data->devices))
> +		goto out;
> +
> +	sdev = list_last_entry(&data->devices, struct snd_soc_usb_device, list);
> +
> +	if ((card == sdev->card_idx) && (pcm == sdev->pcm_idx)) {
> +		if (route == SND_SOC_USB_KCTL_CARD_ROUTE)
> +			ret = component->card->snd_card->number;
> +		else if (route == SND_SOC_USB_KCTL_PCM_ROUTE)
> +			ret = q6usb_get_pcm_id(component);
> +	}
> +
> +out:
> +	mutex_unlock(&data->mutex);
> +
> +	return ret;
> +}

well I obviously didn't get how this function worked until now, it's
supposed to be call TWICE with a different argument.

Not sure it's really wise with the locking, why not get both in one shot?

Also how does this update the kcontrol value?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ