提交 07d48da4 编写于 作者: T Tom St Denis 提交者: Alex Deucher

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: NTom St Denis <tom.stdenis@amd.com>
Reviewed-by: NChristian König <christian.koenig@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 de8dfb8e
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册