public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] drm/rockchip: avoid 64-bit division
@ 2024-10-18 15:10 Arnd Bergmann
  2024-10-18 15:54 ` Dmitry Baryshkov
  2024-11-04 17:29 ` Nathan Chancellor
  0 siblings, 2 replies; 8+ messages in thread
From: Arnd Bergmann @ 2024-10-18 15:10 UTC (permalink / raw)
  To: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Algea Cao, Cristian Ciocaltea
  Cc: Arnd Bergmann, dri-devel, linux-arm-kernel, linux-rockchip,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Dividing a 64-bit integer prevents building this for 32-bit targets:

ERROR: modpost: "__aeabi_uldivmod" [drivers/gpu/drm/rockchip/rockchipdrm.ko] undefined!

As this function is not performance criticial, just Use the div_u64() helper.

Fixes: 128a9bf8ace2 ("drm/rockchip: Add basic RK3588 HDMI output support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
index 9c796ee4c303..c8b362cc2b95 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -82,7 +82,7 @@ static void dw_hdmi_qp_rockchip_encoder_enable(struct drm_encoder *encoder)
 		 * comment in rk_hdptx_phy_power_on() from
 		 * drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c
 		 */
-		phy_set_bus_width(hdmi->phy, rate / 100);
+		phy_set_bus_width(hdmi->phy, div_u64(rate, 100));
 	}
 }
 
-- 
2.39.5



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

end of thread, other threads:[~2024-11-29 14:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-18 15:10 [PATCH] drm/rockchip: avoid 64-bit division Arnd Bergmann
2024-10-18 15:54 ` Dmitry Baryshkov
2024-11-04 17:29 ` Nathan Chancellor
2024-11-22  8:36   ` Geert Uytterhoeven
2024-11-22  9:15     ` Maxime Ripard
2024-11-22  9:33       ` Geert Uytterhoeven
2024-11-25 10:35       ` Geert Uytterhoeven
2024-11-29 14:06         ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox