From: Neil Armstrong <neil.armstrong@linaro.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Cc: Nicolas Dufresne <nicolas.dufresne@collabora.com>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Subject: Re: [PATCH 03/25] media: meson-g2d: Drop unneeded v4l2_m2m_get_vq() NULL check
Date: Wed, 8 Oct 2025 20:13:16 +0200 [thread overview]
Message-ID: <45f68b22-4514-4ddf-95e7-e00f45561307@linaro.org> (raw)
In-Reply-To: <20251008175052.19925-4-laurent.pinchart@ideasonboard.com>
On 10/8/25 19:50, Laurent Pinchart wrote:
> The v4l2_m2m_get_vq() function never returns NULL. The check was
> probably intended to catch invalid format types, but that's not needed
> as the V4L2 core picks the appropriate VIDIOC_G_FMT ioctl handler based
> on the format type, so the type can't be incorrect. Drop the unneeded
> return value check and, as the return value is not used for other
> purposes and the function has no side effect, the function call as well.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/platform/amlogic/meson-ge2d/ge2d.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c
> index 0c004bb8ba05..a9323b383547 100644
> --- a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c
> +++ b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c
> @@ -627,13 +627,8 @@ static int vidioc_s_fmt_cap(struct file *file, void *priv, struct v4l2_format *f
> static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f)
> {
> struct ge2d_ctx *ctx = priv;
> - struct vb2_queue *vq;
> struct ge2d_frame *frm;
>
> - vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type);
> - if (!vq)
> - return -EINVAL;
> -
> frm = get_frame(ctx, f->type);
>
> f->fmt.pix = frm->pix_fmt;
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
next prev parent reply other threads:[~2025-10-08 18:13 UTC|newest]
Thread overview: 42+ 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 01/25] media: v4l2-mem2mem: Document that v4l2_m2m_get_vq() never returns NULL Laurent Pinchart
2025-10-10 8:35 ` Stefan Klug
2025-10-08 17:50 ` [PATCH 02/25] media: allgro-dvt: Drop unneeded v4l2_m2m_get_vq() NULL check Laurent Pinchart
2025-10-08 17:50 ` [PATCH 03/25] media: meson-g2d: " Laurent Pinchart
2025-10-08 18:13 ` Neil Armstrong [this message]
2025-10-08 17:50 ` [PATCH 04/25] media: amphion: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 05/25] media: coda: " Laurent Pinchart
2025-10-09 8:11 ` Philipp Zabel
2025-10-08 17:50 ` [PATCH 06/25] media: imagination: e5010: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 07/25] media: m2m-deinterlace: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 08/25] media: mediatek: jpeg: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 09/25] media: mediatek: vcodec: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 10/25] media: dw100: " Laurent Pinchart
2025-10-10 8:40 ` Stefan Klug
2025-10-08 17:50 ` [PATCH 11/25] media: imx-jpeg: " Laurent Pinchart
2025-10-08 20:01 ` Frank Li
2025-10-08 17:50 ` [PATCH 12/25] media: imx-pxp: " Laurent Pinchart
2025-10-08 20:02 ` Frank Li
2025-10-09 8:11 ` Philipp Zabel
2025-10-08 17:50 ` [PATCH 13/25] media: nxp: imx8-isi: " Laurent Pinchart
2025-10-08 20:02 ` Frank Li
2025-10-08 17:50 ` [PATCH 14/25] media: mx2_emmaprp: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 15/25] media: qcom: iris: " 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
2025-10-09 7:42 ` Dikshita Agarwal
2025-10-08 17:50 ` [PATCH 17/25] media: renesas: fdp1: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 18/25] media: rcar_jpu: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 19/25] media: platform: rga: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 20/25] media: samsung: s5p-g2d: " Laurent Pinchart
2025-10-10 11:00 ` Lukasz Stelmach
2025-10-08 17:50 ` [PATCH 21/25] media: samsung: s5p-jpeg: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 22/25] media: stm32: dma2d: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 23/25] media: ti: vpe: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 24/25] media: vicodec: " Laurent Pinchart
2025-10-08 17:50 ` [PATCH 25/25] media: vim2m: " Laurent Pinchart
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=45f68b22-4514-4ddf-95e7-e00f45561307@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-media@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=nicolas.dufresne@collabora.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