Commit 3b53d304 authored by Christian König's avatar Christian König

drm/ttm: cleanup ttm_handle_caching_state_failure

Remove unused parameters, shorten the function name.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
Link: https://patchwork.freedesktop.org/patch/393431/
parent 1e17792d
...@@ -466,11 +466,11 @@ static int ttm_set_pages_caching(struct page **pages, ...@@ -466,11 +466,11 @@ static int ttm_set_pages_caching(struct page **pages,
* any pages that have changed their caching state already put them to the * any pages that have changed their caching state already put them to the
* pool. * pool.
*/ */
static void ttm_handle_caching_state_failure(struct list_head *pages, static void ttm_handle_caching_failure(struct page **failed_pages,
int ttm_flags, enum ttm_caching_state cstate, unsigned cpages)
struct page **failed_pages, unsigned cpages)
{ {
unsigned i; unsigned i;
/* Failed pages have to be freed */ /* Failed pages have to be freed */
for (i = 0; i < cpages; ++i) { for (i = 0; i < cpages; ++i) {
list_del(&failed_pages[i]->lru); list_del(&failed_pages[i]->lru);
...@@ -516,9 +516,8 @@ static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags, ...@@ -516,9 +516,8 @@ static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags,
r = ttm_set_pages_caching(caching_array, r = ttm_set_pages_caching(caching_array,
cstate, cpages); cstate, cpages);
if (r) if (r)
ttm_handle_caching_state_failure(pages, ttm_handle_caching_failure(caching_array,
ttm_flags, cstate, cpages);
caching_array, cpages);
} }
r = -ENOMEM; r = -ENOMEM;
goto out; goto out;
...@@ -541,9 +540,8 @@ static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags, ...@@ -541,9 +540,8 @@ static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags,
r = ttm_set_pages_caching(caching_array, r = ttm_set_pages_caching(caching_array,
cstate, cpages); cstate, cpages);
if (r) { if (r) {
ttm_handle_caching_state_failure(pages, ttm_handle_caching_failure(caching_array,
ttm_flags, cstate, cpages);
caching_array, cpages);
goto out; goto out;
} }
cpages = 0; cpages = 0;
...@@ -554,9 +552,7 @@ static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags, ...@@ -554,9 +552,7 @@ static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags,
if (cpages) { if (cpages) {
r = ttm_set_pages_caching(caching_array, cstate, cpages); r = ttm_set_pages_caching(caching_array, cstate, cpages);
if (r) if (r)
ttm_handle_caching_state_failure(pages, ttm_handle_caching_failure(caching_array, cpages);
ttm_flags, cstate,
caching_array, cpages);
} }
out: out:
kfree(caching_array); kfree(caching_array);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment