aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/amd
diff options
context:
space:
mode:
authorGravatar Daniel Kurtz <djkurtz@chromium.org> 2018-07-02 15:19:52 -0600
committerGravatar Mark Brown <broonie@kernel.org> 2018-07-03 16:14:29 +0100
commit715cdce04487fb23d5c10693b3bc01309fea955a (patch)
tree401405611a90b799e8d203135ff7f68cc48c9814 /sound/soc/amd
parentASoC: AMD: Always stop ch2 first (diff)
downloadlinux-715cdce04487fb23d5c10693b3bc01309fea955a.tar.gz
linux-715cdce04487fb23d5c10693b3bc01309fea955a.tar.bz2
linux-715cdce04487fb23d5c10693b3bc01309fea955a.zip
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@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd')
-rw-r--r--sound/soc/amd/acp-pcm-dma.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index 4665ae12e74e..034fac3de037 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);
}