Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: meson-g2d: Drop unneeded v4l2_m2m_get_vq() NULL check

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>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Laurent Pinchart and committed by
Hans Verkuil
7adab6aa 688d0b15

-5
-5
drivers/media/platform/amlogic/meson-ge2d/ge2d.c
··· 632 632 static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f) 633 633 { 634 634 struct ge2d_ctx *ctx = file_to_ge2d_ctx(file); 635 - struct vb2_queue *vq; 636 635 struct ge2d_frame *frm; 637 - 638 - vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); 639 - if (!vq) 640 - return -EINVAL; 641 636 642 637 frm = get_frame(ctx, f->type); 643 638