[PATCH 20/25] media: samsung: s5p-g2d: Drop unneeded v4l2_m2m_get_vq() NULL check

Lukasz Stelmach l.stelmach at samsung.com
Fri Oct 10 04:00:01 PDT 2025


It was <2025-10-08 śro 20:50>, when 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 at ideasonboard.com>
> ---
>  drivers/media/platform/samsung/s5p-g2d/g2d.c | 4 ----
>  1 file changed, 4 deletions(-)
>

Reviewed-by: Łukasz Stelmach <l.stelmach at samsung.com>

> diff --git a/drivers/media/platform/samsung/s5p-g2d/g2d.c b/drivers/media/platform/samsung/s5p-g2d/g2d.c
> index ffed16a34493..7b0481c7f953 100644
> --- a/drivers/media/platform/samsung/s5p-g2d/g2d.c
> +++ b/drivers/media/platform/samsung/s5p-g2d/g2d.c
> @@ -306,12 +306,8 @@ static int vidioc_enum_fmt(struct file *file, void *prv, struct v4l2_fmtdesc *f)
>  static int vidioc_g_fmt(struct file *file, void *prv, struct v4l2_format *f)
>  {
>  	struct g2d_ctx *ctx = prv;
> -	struct vb2_queue *vq;
>  	struct g2d_frame *frm;
>  
> -	vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type);
> -	if (!vq)
> -		return -EINVAL;
>  	frm = get_frame(ctx, f->type);
>  	if (IS_ERR(frm))
>  		return PTR_ERR(frm);

-- 
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20251010/187daf19/attachment.sig>


More information about the linux-arm-kernel mailing list