]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: chips-media: wave5: Remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Tue, 26 Aug 2025 14:52:43 +0000 (22:52 +0800)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Thu, 4 Sep 2025 08:37:05 +0000 (10:37 +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>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c

index 279f23e1304a9e47e31c9a0bdd0efbf4c18622e1..506d6c6166a6b0fd9151218cf2c308acef436304 100644 (file)
@@ -543,7 +543,7 @@ static int wave5_vpu_enc_s_fmt_out(struct file *file, void *fh, struct v4l2_form
        if (!info)
                return -EINVAL;
 
-       inst->cbcr_interleave = (info->comp_planes == 2) ? true : false;
+       inst->cbcr_interleave = info->comp_planes == 2;
 
        switch (inst->src_fmt.pixelformat) {
        case V4L2_PIX_FMT_NV21: