linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: omapdrm: dss: replace ternary operator with max()
@ 2022-05-17  5:02 Guo Zhengkui
  2022-09-09 12:58 ` Tomi Valkeinen
  0 siblings, 1 reply; 2+ messages in thread
From: Guo Zhengkui @ 2022-05-17  5:02 UTC (permalink / raw)
  To: Tomi Valkeinen, David Airlie, Daniel Vetter, Neil Armstrong,
	Benoit Parrot, Cai Huoqing, Arnd Bergmann, Guo Zhengkui,
	open list:DRM DRIVERS FOR TI OMAP, open list
  Cc: zhengkui_guo

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm: omapdrm: dss: replace ternary operator with max()
  2022-05-17  5:02 [PATCH] drm: omapdrm: dss: replace ternary operator with max() Guo Zhengkui
@ 2022-09-09 12:58 ` Tomi Valkeinen
  0 siblings, 0 replies; 2+ messages in thread
From: Tomi Valkeinen @ 2022-09-09 12:58 UTC (permalink / raw)
  To: Guo Zhengkui, David Airlie, Daniel Vetter, Neil Armstrong,
	Benoit Parrot, Cai Huoqing, Arnd Bergmann,
	open list:DRM DRIVERS FOR TI OMAP, open list
  Cc: zhengkui_guo

On 17/05/2022 08:02, Guo Zhengkui wrote:
> 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;
>   

Thanks, applying to drm-misc.

  Tomi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-09 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17  5:02 [PATCH] drm: omapdrm: dss: replace ternary operator with max() Guo Zhengkui
2022-09-09 12:58 ` Tomi Valkeinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).