All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: lt8713sx: avoid 64-bit division
@ 2026-03-16 21:56 Arnd Bergmann
  2026-03-25  2:21 ` Dmitry Baryshkov
  2026-03-25  2:31 ` Dmitry Baryshkov
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2026-03-16 21:56 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Dmitry Baryshkov, Prahlad Valluru, Vishnu Saini
  Cc: Arnd Bergmann, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	dri-devel, linux-kernel

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/bridge: lt8713sx: avoid 64-bit division
  2026-03-16 21:56 [PATCH] drm/bridge: lt8713sx: avoid 64-bit division Arnd Bergmann
@ 2026-03-25  2:21 ` Dmitry Baryshkov
  2026-03-25  2:31 ` Dmitry Baryshkov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2026-03-25  2:21 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Prahlad Valluru, Vishnu Saini, Arnd Bergmann, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, dri-devel, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/bridge: lt8713sx: avoid 64-bit division
  2026-03-16 21:56 [PATCH] drm/bridge: lt8713sx: avoid 64-bit division Arnd Bergmann
  2026-03-25  2:21 ` Dmitry Baryshkov
@ 2026-03-25  2:31 ` Dmitry Baryshkov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2026-03-25  2:31 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Prahlad Valluru, Vishnu Saini, Arnd Bergmann
  Cc: Arnd Bergmann, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	dri-devel, linux-kernel

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-25  2:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16 21:56 [PATCH] drm/bridge: lt8713sx: avoid 64-bit division Arnd Bergmann
2026-03-25  2:21 ` Dmitry Baryshkov
2026-03-25  2:31 ` Dmitry Baryshkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.