[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210609070750.1329318-1-libaokun1@huawei.com>
Date: Wed, 9 Jun 2021 15:07:50 +0800
From: Baokun Li <libaokun1@...wei.com>
To: <linux-kernel@...r.kernel.org>,
Christian Koenig <christian.koenig@....com>,
Huang Rui <ray.huang@....com>, David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Sumit Semwal <sumit.semwal@...aro.org>
CC: <weiyongjun1@...wei.com>, <yuehaibing@...wei.com>,
<yangjihong1@...wei.com>, <yukuai3@...wei.com>,
<libaokun1@...wei.com>, <dri-devel@...ts.freedesktop.org>,
<linux-media@...r.kernel.org>, <linaro-mm-sig@...ts.linaro.org>,
<kernel-janitors@...r.kernel.org>, "Hulk Robot" <hulkci@...wei.com>
Subject: [PATCH -next v2] drm/ttm: use list_move instead of list_del/list_add in ttm_execbuf_util.c
Using list_move() instead of list_del() + list_add() in ttm_execbuf_util.c.
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Baokun Li <libaokun1@...wei.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;
Powered by blists - more mailing lists