Thread (98 messages) 98 messages, 3 authors, 2023-09-21
STALE1011d
Revisions (8)
  1. v7 current
  2. v8 [diff vs current]
  3. v9 [diff vs current]
  4. v10 [diff vs current]
  5. v11 [diff vs current]
  6. v12 [diff vs current]
  7. v13 [diff vs current]
  8. v14 [diff vs current]

[PATCH v7 33/49] media: sti: hva: Stop direct calls to queue num_buffers field

From: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Date: 2023-09-14 13:35:01
Also in: linux-arm-msm, linux-media, linux-mediatek, linux-rockchip, linux-staging, lkml
Subsystem: media input infrastructure (v4l/dvb), the rest · Maintainers: Mauro Carvalho Chehab, Linus Torvalds

Use vb2_get_num_buffers() to avoid using queue num_buffer field directly.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
 drivers/media/platform/st/sti/hva/hva-v4l2.c | 7 -------
 1 file changed, 7 deletions(-)
diff --git a/drivers/media/platform/st/sti/hva/hva-v4l2.c b/drivers/media/platform/st/sti/hva/hva-v4l2.c
index 326be09bdb55..cfe83e9dc01b 100644
--- a/drivers/media/platform/st/sti/hva/hva-v4l2.c
+++ b/drivers/media/platform/st/sti/hva/hva-v4l2.c
@@ -569,13 +569,6 @@ static int hva_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
 		struct vb2_buffer *vb2_buf;
 
 		vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, buf->type);
-
-		if (buf->index >= vq->num_buffers) {
-			dev_dbg(dev, "%s buffer index %d out of range (%d)\n",
-				ctx->name, buf->index, vq->num_buffers);
-			return -EINVAL;
-		}
-
 		vb2_buf = vb2_get_buffer(vq, buf->index);
 		if (!vb2_buf) {
 			dev_dbg(dev, "%s buffer index %d not found\n", ctx->name, buf->index);
-- 
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help