lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220517050208.121488-1-guozhengkui@vivo.com>
Date:   Tue, 17 May 2022 13:02:06 +0800
From:   Guo Zhengkui <guozhengkui@...o.com>
To:     Tomi Valkeinen <tomba@...nel.org>, David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Neil Armstrong <narmstrong@...libre.com>,
        Benoit Parrot <bparrot@...com>,
        Cai Huoqing <cai.huoqing@...ux.dev>,
        Arnd Bergmann <arnd@...db.de>,
        Guo Zhengkui <guozhengkui@...o.com>,
        dri-devel@...ts.freedesktop.org (open list:DRM DRIVERS FOR TI OMAP),
        linux-kernel@...r.kernel.org (open list)
Cc:     zhengkui_guo@...look.com
Subject: [PATCH] drm: omapdrm: dss: replace ternary operator with max()

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@...o.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ