DORMANTno replies

[PATCH] drm/sun4i: dsi: Simplify maximum determination in sun6i_dsi_setup_timings()

From: Markus Elfring <hidden>
Date: 2025-02-28 17:34:38
Also in: dri-devel, kernel-janitors, linux-sunxi, lkml
Subsystem: drm drivers, drm drivers and misc gpu patches, drm drivers for allwinner a10, the rest · Maintainers: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Chen-Yu Tsai, Linus Torvalds

From: Markus Elfring <redacted>
Date: Fri, 28 Feb 2025 18:25:31 +0100

Reduce nested max() calls by a single max3() call in this
function implementation.

This issue was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <redacted>
---
 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
index c35b70d83e53..7765a29e2ef6 100644
--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
+++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
@@ -597,7 +597,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
 	}

 	/* How many bytes do we need to send all payloads? */
-	bytes = max_t(size_t, max(max(hfp, hblk), max(hsa, hbp)), vblk);
+	bytes = max_t(size_t, max3(hfp, hblk, max(hsa, hbp)), vblk);
 	buffer = kmalloc(bytes, GFP_KERNEL);
 	if (WARN_ON(!buffer))
 		return;
--
2.48.1

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help