aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-08-31 08:18:03 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-18 11:14:05 -0400
commitc392e9e13e398c3ebf37e60942c2ddadbe823880 (patch)
tree325fbef377a4eb9acb2b4caaa8838f18d621704b /drivers/media/v4l2-core
parent961ae44980034f82d037c982e5b2f8258e055d63 (diff)
[media] media v4l2-mem2mem: Use list_first_entry
Use list_first_entry instead of list_entry which makes the intention of the code more clear. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Pawel Osciak <pawel@osciak.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r--drivers/media/v4l2-core/v4l2-mem2mem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
index 97b48318aee1..3ac83583ad7a 100644
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
@@ -105,7 +105,7 @@ void *v4l2_m2m_next_buf(struct v4l2_m2m_queue_ctx *q_ctx)
105 return NULL; 105 return NULL;
106 } 106 }
107 107
108 b = list_entry(q_ctx->rdy_queue.next, struct v4l2_m2m_buffer, list); 108 b = list_first_entry(&q_ctx->rdy_queue, struct v4l2_m2m_buffer, list);
109 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); 109 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
110 return &b->vb; 110 return &b->vb;
111} 111}
@@ -125,7 +125,7 @@ void *v4l2_m2m_buf_remove(struct v4l2_m2m_queue_ctx *q_ctx)
125 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); 125 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
126 return NULL; 126 return NULL;
127 } 127 }
128 b = list_entry(q_ctx->rdy_queue.next, struct v4l2_m2m_buffer, list); 128 b = list_first_entry(&q_ctx->rdy_queue, struct v4l2_m2m_buffer, list);
129 list_del(&b->list); 129 list_del(&b->list);
130 q_ctx->num_rdy--; 130 q_ctx->num_rdy--;
131 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); 131 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
@@ -178,7 +178,7 @@ static void v4l2_m2m_try_run(struct v4l2_m2m_dev *m2m_dev)
178 return; 178 return;
179 } 179 }
180 180
181 m2m_dev->curr_ctx = list_entry(m2m_dev->job_queue.next, 181 m2m_dev->curr_ctx = list_first_entry(&m2m_dev->job_queue,
182 struct v4l2_m2m_ctx, queue); 182 struct v4l2_m2m_ctx, queue);
183 m2m_dev->curr_ctx->job_flags |= TRANS_RUNNING; 183 m2m_dev->curr_ctx->job_flags |= TRANS_RUNNING;
184 spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags); 184 spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags);