Use the list_first_entry() macro where appropriate to replace manual
usage of list_entry(head.next).
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
int ret;
spin_lock_irq(&ctx->slock);
- buf = list_entry(dma_q->active.next, struct cal_buffer, list);
+ buf = list_first_entry(&dma_q->active, struct cal_buffer, list);
ctx->cur_frm = buf;
ctx->next_frm = buf;
list_del(&buf->list);
struct cal_buffer *buf;
unsigned long addr;
- buf = list_entry(dma_q->active.next, struct cal_buffer, list);
+ buf = list_first_entry(&dma_q->active, struct cal_buffer, list);
addr = vb2_dma_contig_plane_dma_addr(&buf->vb.vb2_buf, 0);
cal_ctx_wr_dma_addr(ctx, addr);