All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guo Zhengkui <guozhengkui@vivo.com>
To: Tomi Valkeinen <tomba@kernel.org>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Benoit Parrot <bparrot@ti.com>,
	Cai Huoqing <cai.huoqing@linux.dev>,
	Arnd Bergmann <arnd@arndb.de>,
	Guo Zhengkui <guozhengkui@vivo.com>,
	dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR TI
	OMAP), linux-kernel@vger.kernel.org (open list)
Cc: zhengkui_guo@outlook.com
Subject: [PATCH] drm: omapdrm: dss: replace ternary operator with max()
Date: Tue, 17 May 2022 13:02:06 +0800	[thread overview]
Message-ID: <20220517050208.121488-1-guozhengkui@vivo.com> (raw)

Fix the following coccicheck warning:

drivers/gpu/drm/omapdrm/dss/dispc.c:2454:21-22: WARNING opportunity for max()

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index c4de142cc85b..0ee344ebcd1c 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -2451,7 +2451,7 @@ static int dispc_ovl_calc_scaling_44xx(struct dispc_device *dispc,
 
 	*decim_x = DIV_ROUND_UP(width, in_width_max);
 
-	*decim_x = *decim_x > decim_x_min ? *decim_x : decim_x_min;
+	*decim_x = max(*decim_x, decim_x_min);
 	if (*decim_x > *x_predecim)
 		return -EINVAL;
 
-- 
2.20.1


             reply	other threads:[~2022-05-17  5:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17  5:02 Guo Zhengkui [this message]
2022-09-09 12:58 ` [PATCH] drm: omapdrm: dss: replace ternary operator with max() Tomi Valkeinen

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=20220517050208.121488-1-guozhengkui@vivo.com \
    --to=guozhengkui@vivo.com \
    --cc=airlied@linux.ie \
    --cc=arnd@arndb.de \
    --cc=bparrot@ti.com \
    --cc=cai.huoqing@linux.dev \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    --cc=tomba@kernel.org \
    --cc=zhengkui_guo@outlook.com \
    /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 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.