From: Guo Zhengkui Date: Tue, 17 May 2022 05:02:06 +0000 (+0800) Subject: drm: omapdrm: dss: replace ternary operator with max() X-Git-Tag: v6.1-rc5~176^2~9^2~88 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8523f53bf09d274da04e64e24841b4f83f98bca;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20220517050208.121488-1-guozhengkui@vivo.com --- diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index c4de142..0ee344e 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;