From: Tom St Denis Date: Fri, 26 Jan 2018 15:13:42 +0000 (-0500) Subject: drm/ttm: Simplify ttm_eu_reserve_buffers() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=07d48da4f45c1990562f0cc4869194013308fb70;p=openwrt%2Fstaging%2Fblogic.git drm/ttm: Simplify ttm_eu_reserve_buffers() Hoist the comparison of the ret to -EDEADLK above the two code paths to simplify the function. Signed-off-by: Tom St Denis Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c index 373ced0b2fc2..fa44f7b15285 100644 --- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c +++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c @@ -139,12 +139,14 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket, */ ttm_eu_backoff_reservation_reverse(list, entry); - if (ret == -EDEADLK && intr) { - ret = ww_mutex_lock_slow_interruptible(&bo->resv->lock, - ticket); - } else if (ret == -EDEADLK) { - ww_mutex_lock_slow(&bo->resv->lock, ticket); - ret = 0; + if (ret == -EDEADLK) { + if (intr) { + ret = ww_mutex_lock_slow_interruptible(&bo->resv->lock, + ticket); + } else { + ww_mutex_lock_slow(&bo->resv->lock, ticket); + ret = 0; + } } if (!ret && entry->shared)