mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/sti: Remove redundant ternary operators
@ 2025-09-04 11:27 Liao Yuanhong
  2025-09-04 16:26 ` Raphaël Gallais-Pou
  2025-09-05 11:26 ` Raphael Gallais-Pou
  0 siblings, 2 replies; 3+ messages in thread
From: Liao Yuanhong @ 2025-09-04 11:27 UTC (permalink / raw)
  To: Alain Volmat, Raphael Gallais-Pou, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	open list:DRM DRIVERS FOR STI, open list
  Cc: Liao Yuanhong

For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
 drivers/gpu/drm/sti/sti_hqvdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index 03684062309b..b76606e9a82d 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -744,7 +744,7 @@ static bool sti_hqvdp_check_hw_scaling(struct sti_hqvdp *hqvdp,
 
 	inv_zy = DIV_ROUND_UP(src_h, dst_h);
 
-	return (inv_zy <= lfw) ? true : false;
+	return inv_zy <= lfw;
 }
 
 /**
-- 
2.34.1


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

* Re: [PATCH] drm/sti: Remove redundant ternary operators
  2025-09-04 11:27 [PATCH] drm/sti: Remove redundant ternary operators Liao Yuanhong
@ 2025-09-04 16:26 ` Raphaël Gallais-Pou
  2025-09-05 11:26 ` Raphael Gallais-Pou
  1 sibling, 0 replies; 3+ messages in thread
From: Raphaël Gallais-Pou @ 2025-09-04 16:26 UTC (permalink / raw)
  To: Liao Yuanhong, Alain Volmat, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter,
	open list:DRM DRIVERS FOR STI, open list



Le 04/09/2025 à 13:27, Liao Yuanhong a écrit :
> For ternary operators in the form of "a ? true : false", if 'a' itself
> returns a boolean result, the ternary operator can be omitted. Remove
> redundant ternary operators to clean up the code.
> 
> Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
> ---

Hi,

Acked-by: Raphaël Gallais-Pou <rgallaispou@gmail.com>

Thanks,
Best regards,
Raphaël

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

* Re: [PATCH] drm/sti: Remove redundant ternary operators
  2025-09-04 11:27 [PATCH] drm/sti: Remove redundant ternary operators Liao Yuanhong
  2025-09-04 16:26 ` Raphaël Gallais-Pou
@ 2025-09-05 11:26 ` Raphael Gallais-Pou
  1 sibling, 0 replies; 3+ messages in thread
From: Raphael Gallais-Pou @ 2025-09-05 11:26 UTC (permalink / raw)
  To: Liao Yuanhong, Alain Volmat, Raphael Gallais-Pou,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, open list:DRM DRIVERS FOR STI,
	open list



On 9/4/25 13:27, Liao Yuanhong wrote:
> For ternary operators in the form of "a ? true : false", if 'a' itself
> returns a boolean result, the ternary operator can be omitted. Remove
> redundant ternary operators to clean up the code.
>
> Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
> ---
>
Hi,

Applied to drm-misc-next.

Best regards,
Raphaël

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

end of thread, other threads:[~2025-09-05 11:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-04 11:27 [PATCH] drm/sti: Remove redundant ternary operators Liao Yuanhong
2025-09-04 16:26 ` Raphaël Gallais-Pou
2025-09-05 11:26 ` Raphael Gallais-Pou

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®