All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH - PCM rate 1/1] pcm: rate: Use signed variable for return of snd_pcm_avail_update
@ 2018-07-04 11:28 twischer
  2018-07-04 13:31 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: twischer @ 2018-07-04 11:28 UTC (permalink / raw)
  To: patch; +Cc: Timo Wischer, alsa-devel

From: Timo Wischer <twischer@de.adit-jv.com>

Without this changes a negative error code returned by
snd_pcm_avail_update() will be not handled correctly

Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>

diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index 4e0c7ca..031a43d 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -970,9 +970,12 @@ static snd_pcm_sframes_t snd_pcm_rate_avail_update(snd_pcm_t *pcm)
 {
 	snd_pcm_rate_t *rate = pcm->private_data;
 	snd_pcm_t *slave = rate->gen.slave;
-	snd_pcm_uframes_t slave_size;
+	snd_pcm_sframes_t slave_size;
 
 	slave_size = snd_pcm_avail_update(slave);
+	if (slave_size < 0)
+		return slave_size;
+
 	if (pcm->stream == SND_PCM_STREAM_CAPTURE)
 		goto _capture;
 	snd_pcm_rate_sync_hwptr(pcm);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH - PCM rate 1/1] pcm: rate: Use signed variable for return of snd_pcm_avail_update
  2018-07-04 11:28 [PATCH - PCM rate 1/1] pcm: rate: Use signed variable for return of snd_pcm_avail_update twischer
@ 2018-07-04 13:31 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2018-07-04 13:31 UTC (permalink / raw)
  To: twischer; +Cc: alsa-devel

On Wed, 04 Jul 2018 13:28:56 +0200,
<twischer@de.adit-jv.com> wrote:
> 
> From: Timo Wischer <twischer@de.adit-jv.com>
> 
> Without this changes a negative error code returned by
> snd_pcm_avail_update() will be not handled correctly
> 
> Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>

This is not about use signed value, but it *adds* the missing error
check from snd_pcm_avail_update().  So, please adjust the subject and
the changelog what you're actually fixing instead.


thanks,

Takashi

> diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
> index 4e0c7ca..031a43d 100644
> --- a/src/pcm/pcm_rate.c
> +++ b/src/pcm/pcm_rate.c
> @@ -970,9 +970,12 @@ static snd_pcm_sframes_t snd_pcm_rate_avail_update(snd_pcm_t *pcm)
>  {
>  	snd_pcm_rate_t *rate = pcm->private_data;
>  	snd_pcm_t *slave = rate->gen.slave;
> -	snd_pcm_uframes_t slave_size;
> +	snd_pcm_sframes_t slave_size;
>  
>  	slave_size = snd_pcm_avail_update(slave);
> +	if (slave_size < 0)
> +		return slave_size;
> +
>  	if (pcm->stream == SND_PCM_STREAM_CAPTURE)
>  		goto _capture;
>  	snd_pcm_rate_sync_hwptr(pcm);
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-04 13:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04 11:28 [PATCH - PCM rate 1/1] pcm: rate: Use signed variable for return of snd_pcm_avail_update twischer
2018-07-04 13:31 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.