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: <a7e97534-0351-4673-9fbe-e02b2aef998c@linux.intel.com>
Date: Wed, 25 Sep 2024 16:48:38 +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,
 dmitry.torokhov@...il.com, corbet@....net, broonie@...nel.org,
 lgirdwood@...il.com, tiwai@...e.com, krzk+dt@...nel.org,
 Thinh.Nguyen@...opsys.com, bgoswami@...cinc.com, robh@...nel.org,
 gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
 linux-sound@...r.kernel.org, linux-input@...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 v28 25/32] ASoC: qcom: qdsp6: Fetch USB offload mapped
 card and PCM device


> +static int q6usb_update_offload_route(struct snd_soc_component *component, int card,
> +				      int pcm, int direction, long *route)
> +{
> +	struct q6usb_port_data *data = dev_get_drvdata(component->dev);
> +	struct snd_soc_usb_device *sdev;
> +	int ret = 0;
> +	int cidx = -1;
> +	int pidx = -1;
> +
> +	mutex_lock(&data->mutex);
> +
> +	if (list_empty(&data->devices) ||
> +	    direction == SNDRV_PCM_STREAM_CAPTURE) {
> +		ret = -ENODEV;
> +		goto out;
> +	}

well the code above seems to invalidate what I understood earlier, in
that an error code is returned instead of a set of -1 values...

> +
> +	sdev = list_last_entry(&data->devices, struct snd_soc_usb_device, list);
> +
> +	/*
> +	 * Will always look for last PCM device discovered/probed as the
> +	 * active offload index.
> +	 */
> +	if (card == sdev->card_idx &&
> +	    pcm == sdev->ppcm_idx[sdev->num_playback - 1]) {
> +		cidx = component->card->snd_card->number;
> +		pidx = q6usb_get_pcm_id(component);
> +	}
> +
> +	if (cidx < 0 || pidx < 0) {
> +		cidx = -1;
> +		pidx = -1;
> +	}
> +
> +out:
> +	route[0] = cidx;
> +	route[1] = pidx;
> +
> +	mutex_unlock(&data->mutex);
> +
> +	return ret;
> +}
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ