Skip to content

Commit

Permalink
drm/ttm: Simplify ttm_bo_wait_unreserved
Browse files Browse the repository at this point in the history
Function ttm_bo_wait_unreserved can be slightly simplified.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Jean Delvare authored and Dave Airlie committed Oct 19, 2010
1 parent 5480f72 commit 965d380
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,13 @@ static void ttm_bo_release_list(struct kref *list_kref)

int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, bool interruptible)
{

if (interruptible) {
int ret = 0;

ret = wait_event_interruptible(bo->event_queue,
return wait_event_interruptible(bo->event_queue,
atomic_read(&bo->reserved) == 0);
if (unlikely(ret != 0))
return ret;
} else {
wait_event(bo->event_queue, atomic_read(&bo->reserved) == 0);
return 0;
}
return 0;
}
EXPORT_SYMBOL(ttm_bo_wait_unreserved);

Expand Down

0 comments on commit 965d380

Please sign in to comment.