From: Daniel Kurtz Date: Mon, 2 Jul 2018 21:19:52 +0000 (-0600) Subject: ASoC: AMD: Always subtract bytescount X-Git-Tag: v4.19~92^2~2^2~207 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=715cdce04487fb23d5c10693b3bc01309fea955a;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Mark Brown --- diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 4665ae1..034fac3 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); }