Skip to contentSkip to conversation

ASoC: tegra: fix build regression 32 bit kernels

PATCH In review Arnd Bergmann 4 participants 4 messages May 8

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

PATCH 1/1 ASoC: tegra: fix build regression 32 bit kernels

From: Arnd Bergmann <[email protected]>

Compile-testing this driver for 32-bit causes a build failure:

x86_64-linux-ld: sound/soc/tegra/tegra210_mixer.o: in function `tegra210_mixer_configure_gain':
tegra210_mixer.c:(.text+0x709): undefined reference to `__udivdi3'

As the driver is only actually used on 64-bit Tegra210, rework the division to use the div_u64() helper that avoids the libgcc call.

Fixes 36645381b864 ("ASoC: tegra: Add per-stream Mixer Fade controls")
---
 sound/soc/tegra/tegra210_mixer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/tegra/tegra210_mixer.c +2 -2
index f05617b5f433..d21f55dad0e3 100644
@@ -157,8 +157,8 @@ static int tegra210_mixer_configure_gain(struct snd_soc_component *cmpnt,
 			if (i == DURATION_N3_ID)
 				val = mixer->duration[id];
 			else if (i == DURATION_INV_N3_ID)
-				val = (u32)(BIT_ULL(31 + TEGRA210_MIXER_PRESCALAR) /
-					    mixer->duration[id]);
+				val = div_u64(BIT_ULL(31 + TEGRA210_MIXER_PRESCALAR),
+					      mixer->duration[id]);
 			else
 				val = gain_params.duration[i];
 		}
Signature · 1 line
2.39.5
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Compile-testing this driver for 32-bit causes a build failure:

x86_64-linux-ld: sound/soc/tegra/tegra210_mixer.o: in function `tegra210_mixer_configure_gain':
tegra210_mixer.c:(.text+0x709): undefined reference to `__udivdi3'

As the driver is only actually used on 64-bit Tegra210, rework the division to use the div_u64() helper that avoids the libgcc call.

To be pedantic: the driver is also used on subsequent generations, but your argument of it only ever being used on 64-bit systems is correct, so:

maintainer
#2 lore raw
In reply to Arnd Bergmann
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Compile-testing this driver for 32-bit causes a build failure:

x86_64-linux-ld: sound/soc/tegra/tegra210_mixer.o: in function `tegra210_mixer_configure_gain':
tegra210_mixer.c:(.text+0x709): undefined reference to `__udivdi3'

Someone already sent this.

#3 lore raw
Quoted 9 lines · Mark Brown
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Compile-testing this driver for 32-bit causes a build failure:

x86_64-linux-ld: sound/soc/tegra/tegra210_mixer.o: in function `tegra210_mixer_configure_gain':
tegra210_mixer.c:(.text+0x709): undefined reference to `__udivdi3'

Someone already sent this.

Indeed. Acked that one too.

Thierry