From: Jean Delvare Date: Sat, 9 Oct 2010 12:36:45 +0000 (+0000) Subject: drm/ttm: Simplify ttm_bo_wait_unreserved X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=965d38074e6eae71757a8baf9a348139e1e6894d;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git drm/ttm: Simplify ttm_bo_wait_unreserved Function ttm_bo_wait_unreserved can be slightly simplified. Signed-off-by: Jean Delvare Cc: Thomas Hellstrom Cc: Jerome Glisse Signed-off-by: Dave Airlie --- 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);