From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org
Cc: Nicolas Dufresne <nicolas.dufresne@collabora.com>,
Vikash Garodia <quic_vgarodia@quicinc.com>,
Dikshita Agarwal <quic_dikshita@quicinc.com>
Subject: Re: [PATCH 16/25] media: qcom: venus: Drop unneeded v4l2_m2m_get_vq() NULL check
Date: Thu, 9 Oct 2025 00:52:12 +0100 [thread overview]
Message-ID: <6caf62b0-e8f3-4753-bb1a-8083f0753431@linaro.org> (raw)
In-Reply-To: <20251008175052.19925-17-laurent.pinchart@ideasonboard.com>
On 08/10/2025 18:50, Laurent Pinchart wrote:
> The v4l2_m2m_get_vq() function never returns NULL. The check may have
> been intended to catch invalid format types, but that's not needed as
> the V4L2 core picks the appropriate VIDIOC_S_FMT ioctl handler based on
> the format type, so the type can't be incorrect. Drop the unneeded
> return value check.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/platform/qcom/venus/vdec.c | 2 --
> drivers/media/platform/qcom/venus/venc.c | 2 --
> 2 files changed, 4 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 29b0d6a5303d..8c77db0f6e76 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -329,8 +329,6 @@ static int vdec_s_fmt(struct file *file, void *fh, struct v4l2_format *f)
> struct vb2_queue *q;
>
> q = v4l2_m2m_get_vq(inst->m2m_ctx, f->type);
> - if (!q)
> - return -EINVAL;
>
> if (vb2_is_busy(q))
> return -EBUSY;
> diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
> index c0a0ccdded80..0fe4cc37118b 100644
> --- a/drivers/media/platform/qcom/venus/venc.c
> +++ b/drivers/media/platform/qcom/venus/venc.c
> @@ -241,8 +241,6 @@ static int venc_s_fmt(struct file *file, void *fh, struct v4l2_format *f)
> struct vb2_queue *q;
>
> q = v4l2_m2m_get_vq(inst->m2m_ctx, f->type);
> - if (!q)
> - return -EINVAL;
>
> if (vb2_is_busy(q))
> return -EBUSY;
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
next prev parent reply other threads:[~2025-10-08 23:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-08 17:50 [PATCH 00/25] media: v4l2-mem2mem: Reduce cargo-cult Laurent Pinchart
2025-10-08 17:50 ` [PATCH 15/25] media: qcom: iris: Drop unneeded v4l2_m2m_get_vq() NULL check Laurent Pinchart
2025-10-08 23:51 ` Bryan O'Donoghue
2025-10-09 13:53 ` Dikshita Agarwal
2025-10-10 11:14 ` Laurent Pinchart
2025-10-08 17:50 ` [PATCH 16/25] media: qcom: venus: " Laurent Pinchart
2025-10-08 23:52 ` Bryan O'Donoghue [this message]
2025-10-09 7:42 ` Dikshita Agarwal
2025-10-08 18:24 ` [PATCH 00/25] media: v4l2-mem2mem: Reduce cargo-cult Nicolas Dufresne
2025-10-08 19:21 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6caf62b0-e8f3-4753-bb1a-8083f0753431@linaro.org \
--to=bryan.odonoghue@linaro.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=quic_dikshita@quicinc.com \
--cc=quic_vgarodia@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox