media: vb2: replace bool by bitfield in vb2_buffer

The bool type is not recommended for use in structs, so replace these
by bitfields.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
Hans Verkuil 2019-02-04 05:11:32 -05:00 committed by Mauro Carvalho Chehab
parent 98617b4567
commit cfc7740835
2 changed files with 8 additions and 8 deletions

View File

@ -934,7 +934,7 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
/* sync buffers */ /* sync buffers */
for (plane = 0; plane < vb->num_planes; ++plane) for (plane = 0; plane < vb->num_planes; ++plane)
call_void_memop(vb, finish, vb->planes[plane].mem_priv); call_void_memop(vb, finish, vb->planes[plane].mem_priv);
vb->synced = false; vb->synced = 0;
} }
spin_lock_irqsave(&q->done_lock, flags); spin_lock_irqsave(&q->done_lock, flags);
@ -1313,8 +1313,8 @@ static int __buf_prepare(struct vb2_buffer *vb)
for (plane = 0; plane < vb->num_planes; ++plane) for (plane = 0; plane < vb->num_planes; ++plane)
call_void_memop(vb, prepare, vb->planes[plane].mem_priv); call_void_memop(vb, prepare, vb->planes[plane].mem_priv);
vb->synced = true; vb->synced = 1;
vb->prepared = true; vb->prepared = 1;
vb->state = orig_state; vb->state = orig_state;
return 0; return 0;
@ -1802,7 +1802,7 @@ int vb2_core_dqbuf(struct vb2_queue *q, unsigned int *pindex, void *pb,
} }
call_void_vb_qop(vb, buf_finish, vb); call_void_vb_qop(vb, buf_finish, vb);
vb->prepared = false; vb->prepared = 0;
if (pindex) if (pindex)
*pindex = vb->index; *pindex = vb->index;
@ -1926,12 +1926,12 @@ static void __vb2_queue_cancel(struct vb2_queue *q)
for (plane = 0; plane < vb->num_planes; ++plane) for (plane = 0; plane < vb->num_planes; ++plane)
call_void_memop(vb, finish, call_void_memop(vb, finish,
vb->planes[plane].mem_priv); vb->planes[plane].mem_priv);
vb->synced = false; vb->synced = 0;
} }
if (vb->prepared) { if (vb->prepared) {
call_void_vb_qop(vb, buf_finish, vb); call_void_vb_qop(vb, buf_finish, vb);
vb->prepared = false; vb->prepared = 0;
} }
__vb2_dqbuf(vb); __vb2_dqbuf(vb);

View File

@ -269,8 +269,8 @@ struct vb2_buffer {
* vb2_plane: per-plane information; do not change * vb2_plane: per-plane information; do not change
*/ */
enum vb2_buffer_state state; enum vb2_buffer_state state;
bool synced; unsigned int synced:1;
bool prepared; unsigned int prepared:1;
struct vb2_plane planes[VB2_MAX_PLANES]; struct vb2_plane planes[VB2_MAX_PLANES];
struct list_head queued_entry; struct list_head queued_entry;