Skip to content

Commit 7db08b2

Browse files
Guenter Roeckbroonie
authored andcommitted
ASoC: amd: use do_div rather than 64 bit division to fix 32 bit builds
ERROR: "__aeabi_uldivmod" [sound/soc/amd/snd-soc-acp-pcm.ko] undefined! 64-bit divides require special operations to avoid build errors on 32-bit systems. [Reword the commit message to make it clearer - Alex] fixes: 61add81 (ASoC: amd: Report accurate hw_ptr during dma) Signed-off-by: Guenter Roeck <groeck@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/678919 Reviewed-by: Jason Clinton <jclinton@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/681618 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent bdd2a85 commit 7db08b2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎sound/soc/amd/acp-pcm-dma.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,12 +856,11 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream)
856856
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
857857
if (bytescount > rtd->renderbytescount)
858858
bytescount = bytescount - rtd->renderbytescount;
859-
pos = bytescount % buffersize;
860859
} else {
861860
if (bytescount > rtd->capturebytescount)
862861
bytescount = bytescount - rtd->capturebytescount;
863-
pos = bytescount % buffersize;
864862
}
863+
pos = do_div(bytescount, buffersize);
865864
return bytes_to_frames(runtime, pos);
866865
}
867866

0 commit comments

Comments
 (0)