All of lore.kernel.org
 help / color / mirror / Atom feed
* [TINYCOMPRESS][PATCH 1/1] compress: fix hpointer error when no sample rate
@ 2013-05-02 13:58 Richard Fitzgerald
  2013-05-23  2:28 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2013-05-02 13:58 UTC (permalink / raw)
  To: vinod.koul; +Cc: alsa-devel, patches, ckeepax, pierre-louis.bossart

Fixes the oops() in compress_get_hpointer() to return
-ENODATA instead of errno if the sample rate is zero.
The value in errno here is not related to the reason
we are returning an error.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
---
 compress.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/compress.c b/compress.c
index e80e598..abd0799 100644
--- a/compress.c
+++ b/compress.c
@@ -315,7 +315,7 @@ int compress_get_hpointer(struct compress *compress,
 	if (ioctl(compress->fd, SNDRV_COMPRESS_AVAIL, &kavail))
 		return oops(compress, errno, "cannot get avail");
 	if (0 == kavail.tstamp.sampling_rate)
-		return oops(compress, errno, "invalid paramter");
+		return oops(compress, -ENODATA, "sample rate unknown");
 	*avail = (unsigned int)kavail.avail;
 	time = kavail.tstamp.pcm_io_frames / kavail.tstamp.sampling_rate;
 	tstamp->tv_sec = time;
-- 
1.7.2.5

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

* Re: [TINYCOMPRESS][PATCH 1/1] compress: fix hpointer error when no sample rate
  2013-05-02 13:58 [TINYCOMPRESS][PATCH 1/1] compress: fix hpointer error when no sample rate Richard Fitzgerald
@ 2013-05-23  2:28 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2013-05-23  2:28 UTC (permalink / raw)
  To: Richard Fitzgerald
  Cc: pierre-louis.bossart, alsa-devel, patches, ckeepax, vinod.koul

On Thu, May 02, 2013 at 02:58:53PM +0100, Richard Fitzgerald wrote:
> Fixes the oops() in compress_get_hpointer() to return
> -ENODATA instead of errno if the sample rate is zero.
> The value in errno here is not related to the reason
> we are returning an error.
> 
> Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Applied thanks

--
~Vinod
> ---
>  compress.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/compress.c b/compress.c
> index e80e598..abd0799 100644
> --- a/compress.c
> +++ b/compress.c
> @@ -315,7 +315,7 @@ int compress_get_hpointer(struct compress *compress,
>  	if (ioctl(compress->fd, SNDRV_COMPRESS_AVAIL, &kavail))
>  		return oops(compress, errno, "cannot get avail");
>  	if (0 == kavail.tstamp.sampling_rate)
> -		return oops(compress, errno, "invalid paramter");
> +		return oops(compress, -ENODATA, "sample rate unknown");
>  	*avail = (unsigned int)kavail.avail;
>  	time = kavail.tstamp.pcm_io_frames / kavail.tstamp.sampling_rate;
>  	tstamp->tv_sec = time;
> -- 
> 1.7.2.5
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2013-05-23  3:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-02 13:58 [TINYCOMPRESS][PATCH 1/1] compress: fix hpointer error when no sample rate Richard Fitzgerald
2013-05-23  2:28 ` Vinod Koul

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.