linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v2] drm/ttm: use list_move instead of list_del/list_add in ttm_execbuf_util.c
@ 2021-06-09  7:07 Baokun Li
  0 siblings, 0 replies; only message in thread
From: Baokun Li @ 2021-06-09  7:07 UTC (permalink / raw)
  To: linux-kernel, Christian Koenig, Huang Rui, David Airlie,
	Daniel Vetter, Sumit Semwal
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, libaokun1,
	dri-devel, linux-media, linaro-mm-sig, kernel-janitors,
	Hulk Robot

Using list_move() instead of list_del() + list_add() in ttm_execbuf_util.c.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
V1->V2:
	CC mailist

 drivers/gpu/drm/ttm/ttm_execbuf_util.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c
index 071c48d672c6..c50943888d04 100644
--- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c
+++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c
@@ -95,8 +95,7 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket,
 		if (ret == -EALREADY && dups) {
 			struct ttm_validate_buffer *safe = entry;
 			entry = list_prev_entry(entry, head);
-			list_del(&safe->head);
-			list_add(&safe->head, dups);
+			list_move(&safe->head, dups);
 			continue;
 		}
 
@@ -135,8 +134,7 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket,
 		/* move this item to the front of the list,
 		 * forces correct iteration of the loop without keeping track
 		 */
-		list_del(&entry->head);
-		list_add(&entry->head, list);
+		list_move(&entry->head, list);
 	}
 
 	return 0;


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-09  6:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09  7:07 [PATCH -next v2] drm/ttm: use list_move instead of list_del/list_add in ttm_execbuf_util.c Baokun Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).