[PATCH -next v2] drm/amdgpu: use list_move instead of list_del/list_add in amdgpu_vm.c

Baokun Li libaokun1 at huawei.com
Wed Jun 9 07:08:31 UTC 2021


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

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

 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 9e3ab3b6c105..684c13aae4d0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -2518,8 +2518,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,
 			list_add(&after->list, &tmp->bo_va->invalids);
 		}
 
-		list_del(&tmp->list);
-		list_add(&tmp->list, &removed);
+		list_move(&tmp->list, &removed);
 
 		tmp = amdgpu_vm_it_iter_next(tmp, saddr, eaddr);
 	}



More information about the amd-gfx mailing list