[PATCH v2 2/3] media: videobuf2-core: reverse the iteration order in __vb2_buf_dmabuf_put

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Release the planes from num_planes - 1 to 0.

Signed-off-by: Yunke Cao <yunkec@xxxxxxxxxxxx>
---
 drivers/media/common/videobuf2/videobuf2-core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
index 702f7b6f783a..a5368cef73bb 100644
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -320,10 +320,10 @@ static void __vb2_plane_dmabuf_put(struct vb2_buffer *vb, struct vb2_plane *p)
  */
 static void __vb2_buf_dmabuf_put(struct vb2_buffer *vb)
 {
-	unsigned int plane;
+	unsigned int i;
 
-	for (plane = 0; plane < vb->num_planes; ++plane)
-		__vb2_plane_dmabuf_put(vb, &vb->planes[plane]);
+	for (i = 0; i < vb->num_planes; ++i)
+		__vb2_plane_dmabuf_put(vb, &vb->planes[vb->num_planes - 1 - i]);
 }
 
 /*
-- 
2.44.0.478.gd926399ef9-goog





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux