Skip to content

Commit

Permalink
[media] V4L: fix a confusing function name
Browse files Browse the repository at this point in the history
is_state_active_or_queued() actually returns true if the buffer's state
is neither active nore queued. Rename it for clarity.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
Acked-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
lyakh authored and mchehab committed Mar 3, 2016
1 parent 0724745 commit 5eba172
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/media/v4l2-core/videobuf-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ struct videobuf_buffer *videobuf_alloc_vb(struct videobuf_queue *q)
}
EXPORT_SYMBOL_GPL(videobuf_alloc_vb);

static int is_state_active_or_queued(struct videobuf_queue *q, struct videobuf_buffer *vb)
static int state_neither_active_nor_queued(struct videobuf_queue *q,
struct videobuf_buffer *vb)
{
unsigned long flags;
bool rc;
Expand All @@ -95,7 +96,7 @@ int videobuf_waiton(struct videobuf_queue *q, struct videobuf_buffer *vb,
MAGIC_CHECK(vb->magic, MAGIC_BUFFER);

if (non_blocking) {
if (is_state_active_or_queued(q, vb))
if (state_neither_active_nor_queued(q, vb))
return 0;
return -EAGAIN;
}
Expand All @@ -107,9 +108,10 @@ int videobuf_waiton(struct videobuf_queue *q, struct videobuf_buffer *vb,
if (is_ext_locked)
mutex_unlock(q->ext_lock);
if (intr)
ret = wait_event_interruptible(vb->done, is_state_active_or_queued(q, vb));
ret = wait_event_interruptible(vb->done,
state_neither_active_nor_queued(q, vb));
else
wait_event(vb->done, is_state_active_or_queued(q, vb));
wait_event(vb->done, state_neither_active_nor_queued(q, vb));
/* Relock */
if (is_ext_locked)
mutex_lock(q->ext_lock);
Expand Down

0 comments on commit 5eba172

Please sign in to comment.