diff mbox

ASoC: Intel: sst: fix a loop timeout in sst_hsw_stream_reset()

Message ID 20160406113606.GA23032@mwanda (mailing list archive)
State Accepted
Commit b8af8b1d80db13dd4f5e5a3698180bd9c14aee03
Headers show

Commit Message

Dan Carpenter April 6, 2016, 11:36 a.m. UTC
In the original code we ended the loop with tries set to -1 instead of
zero.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Not tested.

Comments

Keyon Jie April 7, 2016, 1:21 a.m. UTC | #1
On 2016?04?06? 19:36, Dan Carpenter wrote:
> In the original code we ended the loop with tries set to -1 instead of
> zero.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Jie Yang <yang.jie@intel.com>

Dan, thanks for finding and correcting it.

Thanks,
~Keyon

> ---
> Not tested.
>
> diff --git a/sound/soc/intel/haswell/sst-haswell-ipc.c b/sound/soc/intel/haswell/sst-haswell-ipc.c
> index ac60f13..9156522 100644
> --- a/sound/soc/intel/haswell/sst-haswell-ipc.c
> +++ b/sound/soc/intel/haswell/sst-haswell-ipc.c
> @@ -1345,7 +1345,7 @@ int sst_hsw_stream_reset(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
>   		return 0;
>
>   	/* wait for pause to complete before we reset the stream */
> -	while (stream->running && tries--)
> +	while (stream->running && --tries)
>   		msleep(1);
>   	if (!tries) {
>   		dev_err(hsw->dev, "error: reset stream %d still running\n",
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
diff mbox

Patch

diff --git a/sound/soc/intel/haswell/sst-haswell-ipc.c b/sound/soc/intel/haswell/sst-haswell-ipc.c
index ac60f13..9156522 100644
--- a/sound/soc/intel/haswell/sst-haswell-ipc.c
+++ b/sound/soc/intel/haswell/sst-haswell-ipc.c
@@ -1345,7 +1345,7 @@  int sst_hsw_stream_reset(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
 		return 0;
 
 	/* wait for pause to complete before we reset the stream */
-	while (stream->running && tries--)
+	while (stream->running && --tries)
 		msleep(1);
 	if (!tries) {
 		dev_err(hsw->dev, "error: reset stream %d still running\n",