[PATCH] media: v4l: subdev: Fix coverity issue: Logically dead code

From: Chris Green
Date: Tue Apr 08 2025 - 16:32:38 EST


The conditional (type == V4L2_TUNER_RADIO) always evaluates true due to the
earlier check for (type != V4L2_TUNER_RADIO) (line 2826)

CID: 1226742

Signed-off-by: Chris Green <chris.e.green@xxxxxxxxxxx>
---
drivers/media/v4l2-core/v4l2-ioctl.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index a16fb44c7246..275846a6850d 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -2833,8 +2833,7 @@ static int v4l_enum_freq_bands(const struct v4l2_ioctl_ops *ops,
p->capability = m.capability | V4L2_TUNER_CAP_FREQ_BANDS;
p->rangelow = m.rangelow;
p->rangehigh = m.rangehigh;
- p->modulation = (type == V4L2_TUNER_RADIO) ?
- V4L2_BAND_MODULATION_FM : V4L2_BAND_MODULATION_VSB;
+ p->modulation = V4L2_BAND_MODULATION_FM;
return 0;
}
return -ENOTTY;