Skip to contentSkip to conversation

drm/bridge: lt8713sx: avoid 64-bit division

PATCH Applied Arnd Bergmann 2 participants 3 messages Mar 16 – Mar 25

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

PATCH 1/1 drm/bridge: lt8713sx: avoid 64-bit division

From: Arnd Bergmann <[email protected]>

On 32-bit kernels, 64-bit integers cannot be passed to the division operator:

ld.lld-22: error: undefined symbol: __aeabi_uldivmod

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by lontium-lt8713sx.c
drivers/gpu/drm/bridge/lontium-lt8713sx.o:(lt8713sx_firmware_store) in archive vmlinux.a

Since this is a constant number used to divide a size_t, just change the type to that as well.

Fixes 4037c6adc1f9 ("drm/bridge: add support for lontium lt8713sx bridge driver")
---
 drivers/gpu/drm/bridge/lontium-lt8713sx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/lontium-lt8713sx.c +1 -1
index a8ae38c84719..18fac6a46db4 100644
@@ -100,7 +100,7 @@ static void lt8713sx_i2c_disable(struct lt8713sx *lt8713sx)
 static int lt8713sx_prepare_firmware_data(struct lt8713sx *lt8713sx)
 {
 	int ret = 0;
-	u64 sz_12k = 12 * SZ_1K;
+	size_t sz_12k = 12 * SZ_1K;
 
 	ret = request_firmware(&lt8713sx->fw, FW_FILE, lt8713sx->dev);
 	if (ret < 0) {
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

On 32-bit kernels, 64-bit integers cannot be passed to the division operator:

ld.lld-22: error: undefined symbol: __aeabi_uldivmod

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by lontium-lt8713sx.c
drivers/gpu/drm/bridge/lontium-lt8713sx.o:(lt8713sx_firmware_store) in archive vmlinux.a

Since this is a constant number used to divide a size_t, just change the type to that as well.

And if the firmware size doesn't fit 32bits, we are in trouble anyway.

Quoted 7 lines
Fixes 4037c6adc1f9 ("drm/bridge: add support for lontium lt8713sx bridge driver")
---
 drivers/gpu/drm/bridge/lontium-lt8713sx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
With best wishes
Dmitry
#2 lore raw
In reply to Arnd Bergmann
Quoted 10 lines · Arnd Bergmann

On 32-bit kernels, 64-bit integers cannot be passed to the division operator:

ld.lld-22: error: undefined symbol: __aeabi_uldivmod

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by lontium-lt8713sx.c
drivers/gpu/drm/bridge/lontium-lt8713sx.o:(lt8713sx_firmware_store) in archive vmlinux.a

Since this is a constant number used to divide a size_t, just change the type to that as well.

[...]

Applied to drm-misc-next, thanks!

[1/1] drm/bridge: lt8713sx: avoid 64-bit division

      commit: c196276f7809ac89743e6de61262c1b4b84f78d0

Best regards,

Signature · 2 lines
With best wishes
Dmitry