[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180702211956.149355-3-djkurtz@chromium.org>
Date: Mon, 2 Jul 2018 15:19:52 -0600
From: Daniel Kurtz <djkurtz@...omium.org>
To: unlisted-recipients:; (no To-header on input)
Cc: Daniel Kurtz <djkurtz@...omium.org>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
"Mukunda, Vijendar" <Vijendar.Mukunda@....com>,
Alex Deucher <alexander.deucher@....com>,
Akshu Agrawal <akshu.agrawal@....com>,
Guenter Roeck <linux@...ck-us.net>,
alsa-devel@...a-project.org (moderated list:SOUND - SOC LAYER / DYNAMIC
AUDIO POWER MANAGEM...), linux-kernel@...r.kernel.org (open list)
Subject: [PATCH 3/6] ASoC: AMD: Always subtract bytescount
It is always correct to subtract out the starting bytescount value. Even
in the case of 2^64 byte rollover (292 Million Years in the future
@ 48000 Hz) the math still works out.
Signed-off-by: Daniel Kurtz <djkurtz@...omium.org>
---
sound/soc/amd/acp-pcm-dma.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index e6f85f2e5ac2a..224383fef0c3a 100644
--- a/sound/soc/amd/acp-pcm-dma.c
+++ b/sound/soc/amd/acp-pcm-dma.c
@@ -995,8 +995,7 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream)
buffersize = frames_to_bytes(runtime, runtime->buffer_size);
bytescount = acp_get_byte_count(rtd);
- if (bytescount > rtd->bytescount)
- bytescount -= rtd->bytescount;
+ bytescount -= rtd->bytescount;
pos = do_div(bytescount, buffersize);
return bytes_to_frames(runtime, pos);
}
--
2.18.0.399.gad0ab374a1-goog
Powered by blists - more mailing lists