* [PATCH] V4L: mem2mem: use available list manipulation API
@ 2012-04-27 8:13 Guennadi Liakhovetski
2012-04-27 8:34 ` Sylwester Nawrocki
0 siblings, 1 reply; 2+ messages in thread
From: Guennadi Liakhovetski @ 2012-04-27 8:13 UTC (permalink / raw)
To: Linux Media Mailing List; +Cc: Pawel Osciak
Use an available standard list_first_entry() function instead of
open-coding.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
diff --git a/drivers/media/video/v4l2-mem2mem.c b/drivers/media/video/v4l2-mem2mem.c
index 975d0fa..aaa67d3 100644
--- a/drivers/media/video/v4l2-mem2mem.c
+++ b/drivers/media/video/v4l2-mem2mem.c
@@ -102,7 +102,7 @@ void *v4l2_m2m_next_buf(struct v4l2_m2m_queue_ctx *q_ctx)
return NULL;
}
- b = list_entry(q_ctx->rdy_queue.next, struct v4l2_m2m_buffer, list);
+ b = list_first_entry(&q_ctx->rdy_queue, struct v4l2_m2m_buffer, list);
spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
return &b->vb;
}
@@ -122,7 +122,7 @@ void *v4l2_m2m_buf_remove(struct v4l2_m2m_queue_ctx *q_ctx)
spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
return NULL;
}
- b = list_entry(q_ctx->rdy_queue.next, struct v4l2_m2m_buffer, list);
+ b = list_first_entry(&q_ctx->rdy_queue, struct v4l2_m2m_buffer, list);
list_del(&b->list);
q_ctx->num_rdy--;
spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
@@ -175,7 +175,7 @@ static void v4l2_m2m_try_run(struct v4l2_m2m_dev *m2m_dev)
return;
}
- m2m_dev->curr_ctx = list_entry(m2m_dev->job_queue.next,
+ m2m_dev->curr_ctx = list_first_entry(&m2m_dev->job_queue,
struct v4l2_m2m_ctx, queue);
m2m_dev->curr_ctx->job_flags |= TRANS_RUNNING;
spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-27 8:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-27 8:13 [PATCH] V4L: mem2mem: use available list manipulation API Guennadi Liakhovetski
2012-04-27 8:34 ` Sylwester Nawrocki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.