drm/ttm: Simplify ttm_bo_wait_unreserved
authorJean Delvare <khali@linux-fr.org>
Sat, 9 Oct 2010 12:36:45 +0000 (12:36 +0000)
committerDave Airlie <airlied@redhat.com>
Tue, 19 Oct 2010 04:12:27 +0000 (14:12 +1000)
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>
drivers/gpu/drm/ttm/ttm_bo.c

index 5ef0103..9f2eed5 100644 (file)
@@ -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);