RE: [PATCH 3/8] drm/ttm: cleanup ttm_handle_caching_state_failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>-----Original Message-----
>From: dri-devel <dri-devel-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of
>Christian König
>Sent: Thursday, October 1, 2020 7:28 AM
>To: dri-devel@xxxxxxxxxxxxxxxxxxxxx; ray.huang@xxxxxxx;
>airlied@xxxxxxxxx; daniel@xxxxxxxx
>Subject: [PATCH 3/8] drm/ttm: cleanup ttm_handle_caching_state_failure
>
>Remove unused parameters, shorten the function name.

Looks good to me.

Reviewed-by: Michael J. Ruhl <michael.j.ruhl@xxxxxxxxx>

M

>Signed-off-by: Christian König <christian.koenig@xxxxxxx>
>---
> drivers/gpu/drm/ttm/ttm_page_alloc.c | 20 ++++++++------------
> 1 file changed, 8 insertions(+), 12 deletions(-)
>
>diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c
>b/drivers/gpu/drm/ttm/ttm_page_alloc.c
>index 912c30dcc9db..111031cbb6df 100644
>--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
>+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
>@@ -467,11 +467,11 @@ static int ttm_set_pages_caching(struct page
>**pages,
>  * any pages that have changed their caching state already put them to the
>  * pool.
>  */
>-static void ttm_handle_caching_state_failure(struct list_head *pages,
>-		int ttm_flags, enum ttm_caching_state cstate,
>-		struct page **failed_pages, unsigned cpages)
>+static void ttm_handle_caching_failure(struct page **failed_pages,
>+				       unsigned cpages)
> {
> 	unsigned i;
>+
> 	/* Failed pages have to be freed */
> 	for (i = 0; i < cpages; ++i) {
> 		list_del(&failed_pages[i]->lru);
>@@ -517,9 +517,8 @@ static int ttm_alloc_new_pages(struct list_head
>*pages, gfp_t gfp_flags,
> 				r = ttm_set_pages_caching(caching_array,
> 							  cstate, cpages);
> 				if (r)
>-
>	ttm_handle_caching_state_failure(pages,
>-						ttm_flags, cstate,
>-						caching_array, cpages);
>+
>	ttm_handle_caching_failure(caching_array,
>+								   cpages);
> 			}
> 			r = -ENOMEM;
> 			goto out;
>@@ -542,9 +541,8 @@ static int ttm_alloc_new_pages(struct list_head
>*pages, gfp_t gfp_flags,
> 				r = ttm_set_pages_caching(caching_array,
> 						cstate, cpages);
> 				if (r) {
>-
>	ttm_handle_caching_state_failure(pages,
>-						ttm_flags, cstate,
>-						caching_array, cpages);
>+
>	ttm_handle_caching_failure(caching_array,
>+								   cpages);
> 					goto out;
> 				}
> 				cpages = 0;
>@@ -555,9 +553,7 @@ static int ttm_alloc_new_pages(struct list_head
>*pages, gfp_t gfp_flags,
> 	if (cpages) {
> 		r = ttm_set_pages_caching(caching_array, cstate, cpages);
> 		if (r)
>-			ttm_handle_caching_state_failure(pages,
>-					ttm_flags, cstate,
>-					caching_array, cpages);
>+			ttm_handle_caching_failure(caching_array, cpages);
> 	}
> out:
> 	kfree(caching_array);
>--
>2.17.1
>
>_______________________________________________
>dri-devel mailing list
>dri-devel@xxxxxxxxxxxxxxxxxxxxx
>https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux