linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: synopsys: hdmirx: media: Remove redundant ternary operators
@ 2025-08-26 14:50 Liao Yuanhong
  2025-08-27 16:44 ` Dmitry Osipenko
  0 siblings, 1 reply; 2+ messages in thread
From: Liao Yuanhong @ 2025-08-26 14:50 UTC (permalink / raw)
  To: Shreeya Patel, Mauro Carvalho Chehab,
	open list:SYNOPSYS DESIGNWARE HDMI RX CONTROLLER DRIVER,
	open list:SYNOPSYS DESIGNWARE HDMI RX CONTROLLER DRIVER,
	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/media/platform/synopsys/hdmirx/snps_hdmirx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
index b7d278b3889f..c3007e09bc9f 100644
--- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
+++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
@@ -237,7 +237,7 @@ static bool tx_5v_power_present(struct snps_hdmirx_dev *hdmirx_dev)
 			break;
 	}
 
-	ret = (cnt >= detection_threshold) ? true : false;
+	ret = cnt >= detection_threshold;
 	v4l2_dbg(3, debug, &hdmirx_dev->v4l2_dev, "%s: %d\n", __func__, ret);
 
 	return ret;
-- 
2.34.1


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

* Re: [PATCH] media: synopsys: hdmirx: media: Remove redundant ternary operators
  2025-08-26 14:50 [PATCH] media: synopsys: hdmirx: media: Remove redundant ternary operators Liao Yuanhong
@ 2025-08-27 16:44 ` Dmitry Osipenko
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Osipenko @ 2025-08-27 16:44 UTC (permalink / raw)
  To: Liao Yuanhong, Shreeya Patel, Mauro Carvalho Chehab,
	open list:SYNOPSYS DESIGNWARE HDMI RX CONTROLLER DRIVER,
	open list:SYNOPSYS DESIGNWARE HDMI RX CONTROLLER DRIVER,
	open list

On 8/26/25 17:50, 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>
> ---
>  drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> index b7d278b3889f..c3007e09bc9f 100644
> --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> @@ -237,7 +237,7 @@ static bool tx_5v_power_present(struct snps_hdmirx_dev *hdmirx_dev)
>  			break;
>  	}
>  
> -	ret = (cnt >= detection_threshold) ? true : false;
> +	ret = cnt >= detection_threshold;
>  	v4l2_dbg(3, debug, &hdmirx_dev->v4l2_dev, "%s: %d\n", __func__, ret);
>  
>  	return ret;

Acked-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>

-- 
Best regards,
Dmitry

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

end of thread, other threads:[~2025-08-27 16:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26 14:50 [PATCH] media: synopsys: hdmirx: media: Remove redundant ternary operators Liao Yuanhong
2025-08-27 16:44 ` Dmitry Osipenko

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).