diff options
author | Jean Delvare <khali@linux-fr.org> | 2010-10-09 16:36:45 +0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-10-19 08:12:27 +0400 |
commit | 965d38074e6eae71757a8baf9a348139e1e6894d (patch) | |
tree | f15b60ba4a52aead059a5e6bf651765db337b832 /drivers/gpu/drm/ttm | |
parent | 5480f727dc4c049eb46b191bfaeb034067aa6835 (diff) | |
download | linux-965d38074e6eae71757a8baf9a348139e1e6894d.tar.xz |
drm/ttm: Simplify ttm_bo_wait_unreserved
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>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 5ef0103bd0b6..9f2eed520fc3 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -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); |