media: atomisp: Use vb2_get_buffer() instead of directly access to buffers array
authorBenjamin Gaignard <benjamin.gaignard@collabora.com>
Thu, 9 Nov 2023 16:34:32 +0000 (17:34 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 23 Nov 2023 11:06:51 +0000 (12:06 +0100)
Use vb2_get_buffer() instead of direct access to the vb2_queue bufs array.
This allows us to change the type of the bufs in the future.
No need to check the result of vb2_get_buffer, vb2_ioctl_dqbuf() already
checked that it is valid.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
CC: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_ioctl.c

index a8e4779d007f4a3cbf0278941597a8d1828ad38e..a8a964b2f1a8ee6d47b3d65a74cc3385ef5eb0c4 100644 (file)
@@ -1059,7 +1059,7 @@ static int atomisp_dqbuf_wrapper(struct file *file, void *fh, struct v4l2_buffer
        if (ret)
                return ret;
 
-       vb = pipe->vb_queue.bufs[buf->index];
+       vb = vb2_get_buffer(&pipe->vb_queue, buf->index);
        frame = vb_to_frame(vb);
 
        buf->reserved = asd->frame_status[buf->index];