summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2008-12-14 19:05:36 -0500
committerAndy Walls <awalls@radix.net>2008-12-14 19:05:36 -0500
commit75db59d39a9a9df4b32e034d483c126aed873c1a (patch)
treea4846accd5845829b5c56151e428fd9ee66af65a /linux/drivers/media/video
parent33d2dd93cb9c5d52dfee61dcd037b3dc290ada81 (diff)
downloadmediapointer-dvb-s2-75db59d39a9a9df4b32e034d483c126aed873c1a.tar.gz
mediapointer-dvb-s2-75db59d39a9a9df4b32e034d483c126aed873c1a.tar.bz2
cx18: Convert some list manipulations to emphasize entries not lists
From: Andy Walls <awalls@radix.net> Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/cx18/cx18-queue.c14
-rw-r--r--linux/drivers/media/video/cx18/cx18-streams.c4
2 files changed, 7 insertions, 11 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-queue.c b/linux/drivers/media/video/cx18/cx18-queue.c
index 2c58b0c47..8d9441e88 100644
--- a/linux/drivers/media/video/cx18/cx18-queue.c
+++ b/linux/drivers/media/video/cx18/cx18-queue.c
@@ -77,8 +77,8 @@ struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q)
mutex_lock(&s->qlock);
if (!list_empty(&q->list)) {
- buf = list_entry(q->list.next, struct cx18_buffer, list);
- list_del_init(q->list.next);
+ buf = list_first_entry(&q->list, struct cx18_buffer, list);
+ list_del_init(&buf->list);
q->bytesused -= buf->bytesused - buf->readpos;
buf->skipped = 0;
atomic_dec(&q->buffers);
@@ -92,13 +92,11 @@ struct cx18_buffer *cx18_queue_get_buf(struct cx18_stream *s, u32 id,
{
struct cx18 *cx = s->cx;
struct cx18_buffer *buf;
+ struct cx18_buffer *tmp;
struct cx18_buffer *ret = NULL;
- struct list_head *p, *t;
mutex_lock(&s->qlock);
- list_for_each_safe(p, t, &s->q_busy.list) {
- buf = list_entry(p, struct cx18_buffer, list);
-
+ list_for_each_entry_safe(buf, tmp, &s->q_busy.list, list) {
if (buf->id != id) {
buf->skipped++;
if (buf->skipped >= atomic_read(&s->q_busy.buffers)-1) {
@@ -152,8 +150,8 @@ static void cx18_queue_flush(struct cx18_stream *s, struct cx18_queue *q)
mutex_lock(&s->qlock);
while (!list_empty(&q->list)) {
- buf = list_entry(q->list.next, struct cx18_buffer, list);
- list_move_tail(q->list.next, &s->q_free.list);
+ buf = list_first_entry(&q->list, struct cx18_buffer, list);
+ list_move_tail(&buf->list, &s->q_free.list);
buf->bytesused = buf->readpos = buf->b_flags = buf->skipped = 0;
atomic_inc(&s->q_free.buffers);
}
diff --git a/linux/drivers/media/video/cx18/cx18-streams.c b/linux/drivers/media/video/cx18/cx18-streams.c
index acaf774d8..5acefd059 100644
--- a/linux/drivers/media/video/cx18/cx18-streams.c
+++ b/linux/drivers/media/video/cx18/cx18-streams.c
@@ -442,7 +442,6 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s)
{
u32 data[MAX_MB_ARGUMENTS];
struct cx18 *cx = s->cx;
- struct list_head *p;
struct cx18_buffer *buf;
int ts = 0;
int captype = 0;
@@ -529,8 +528,7 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s)
/* Init all the cpu_mdls for this stream */
cx18_flush_queues(s);
mutex_lock(&s->qlock);
- list_for_each(p, &s->q_free.list) {
- buf = list_entry(p, struct cx18_buffer, list);
+ list_for_each_entry(buf, &s->q_free.list, list) {
cx18_writel(cx, buf->dma_handle,
&cx->scb->cpu_mdl[buf->id].paddr);
cx18_writel(cx, s->buf_size, &cx->scb->cpu_mdl[buf->id].length);