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

Arnd Bergmann posted 1 patch 3 weeks ago
drivers/gpu/drm/bridge/lontium-lt8713sx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] drm/bridge: lt8713sx: avoid 64-bit division
Posted by Arnd Bergmann 3 weeks ago
From: Arnd Bergmann <arnd@arndb.de>

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

ld.lld-22: error: undefined symbol: __aeabi_uldivmod
>>> 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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/bridge/lontium-lt8713sx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt8713sx.c b/drivers/gpu/drm/bridge/lontium-lt8713sx.c
index a8ae38c84719..18fac6a46db4 100644
--- a/drivers/gpu/drm/bridge/lontium-lt8713sx.c
+++ b/drivers/gpu/drm/bridge/lontium-lt8713sx.c
@@ -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) {
-- 
2.39.5
Re: [PATCH] drm/bridge: lt8713sx: avoid 64-bit division
Posted by Dmitry Baryshkov 1 week, 5 days ago
On Mon, 16 Mar 2026 22:56:32 +0100, Arnd Bergmann wrote:
> On 32-bit kernels, 64-bit integers cannot be passed to the division operator:
> 
> ld.lld-22: error: undefined symbol: __aeabi_uldivmod
> >>> 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,
-- 
With best wishes
Dmitry
Re: [PATCH] drm/bridge: lt8713sx: avoid 64-bit division
Posted by Dmitry Baryshkov 1 week, 5 days ago
On Mon, Mar 16, 2026 at 10:56:32PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> On 32-bit kernels, 64-bit integers cannot be passed to the division operator:
> 
> ld.lld-22: error: undefined symbol: __aeabi_uldivmod
> >>> 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.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


> 
> Fixes: 4037c6adc1f9 ("drm/bridge: add support for lontium lt8713sx bridge driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/gpu/drm/bridge/lontium-lt8713sx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

-- 
With best wishes
Dmitry