summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-10-09 12:36:45 +0000
committerDave Airlie <airlied@redhat.com>2010-10-19 14:12:27 +1000
commit965d38074e6eae71757a8baf9a348139e1e6894d (patch)
treef15b60ba4a52aead059a5e6bf651765db337b832
parent5480f727dc4c049eb46b191bfaeb034067aa6835 (diff)
downloadlinux-965d38074e6eae71757a8baf9a348139e1e6894d.tar.gz
linux-965d38074e6eae71757a8baf9a348139e1e6894d.tar.bz2
linux-965d38074e6eae71757a8baf9a348139e1e6894d.zip
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>
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c9
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);