From: Markus Elfring <Markus.Elfring@web.de>
To: dri-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
Chen-Yu Tsai <wens@csie.org>, David Airlie <airlied@gmail.com>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Samuel Holland <samuel@sholland.org>,
Simona Vetter <simona@ffwll.ch>,
Thomas Zimmermann <tzimmermann@suse.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org, Qasim Ijaz <qasdev00@gmail.com>
Subject: [PATCH] drm/sun4i: dsi: Simplify maximum determination in sun6i_dsi_setup_timings()
Date: Fri, 28 Feb 2025 18:33:47 +0100 [thread overview]
Message-ID: <8b046033-0f97-49e0-afdd-a3a3a3c23ec4@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
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
reply other threads:[~2025-02-28 17:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8b046033-0f97-49e0-afdd-a3a3a3c23ec4@web.de \
--to=markus.elfring@web.de \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=qasdev00@gmail.com \
--cc=samuel@sholland.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®