Skip to contentSkip to conversation

ASoC: amd: use do_div rather than 64 bit division to fix 32 bit builds

PATCH In review Alex Deucher 2 participants 2 messages Nov 8, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: amd: use do_div rather than 64 bit division to fix 32 bit builds

From: Guenter Roeck <[email protected]>

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 61add8147942 (ASoC: amd: Report accurate hw_ptr during dma)

Reviewed-on: https://chromium-review.googlesource.com/678919

(cherry picked from commit 7ca726e80f21abdbaed9a5a70def1c33a26f8533)

Reviewed-on: https://chromium-review.googlesource.com/681618

---
 sound/soc/amd/acp-pcm-dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/amd/acp-pcm-dma.c +1 -2
index 13d040a4d26f..ef7e98ad960c 100644
@@ -856,12 +856,11 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream)
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
 		if (bytescount > rtd->renderbytescount)
 			bytescount = bytescount - rtd->renderbytescount;
-		pos =  bytescount % buffersize;
 	} else {
 		if (bytescount > rtd->capturebytescount)
 			bytescount = bytescount - rtd->capturebytescount;
-		pos = bytescount % buffersize;
 	}
+	pos = do_div(bytescount, buffersize);
 	return bytes_to_frames(runtime, pos);
 }
 
Signature · 1 line
2.13.6
maintainer
#1 lore raw
Quoted 1 line · Alex Deucher
Fixes 61add8147942 (ASoC: amd: Report accurate hw_ptr during dma)

Fixes:

Quoted 4 lines

Reviewed-on: https://chromium-review.googlesource.com/678919

(cherry picked from commit 7ca726e80f21abdbaed9a5a70def1c33a26f8533)

This isn't how we show cherry picks upstream for stable (you need a tree reference of some kind) and it's not relevant if you ever cherry picked anything in your internal process anyway.