]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: synopsys: hdmirx: media: Remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Tue, 26 Aug 2025 14:50:56 +0000 (22:50 +0800)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 14 Oct 2025 13:07:36 +0000 (15:07 +0200)
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>
Acked-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c

index b7d278b3889f28177b6efc67b01f37cc69aae679..c3007e09bc9f61462dbfd9832bd3d296e780735f 100644 (file)
@@ -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;