From 66aca8f04bb982b9f429fbce384beaa4badae21a Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Fri, 29 Sep 2023 10:31:03 -0700 Subject: [PATCH] drm/xe/vm: use list_last_entry() to fetch last_op I would imagine that it's more efficient to fetch ops_list->prev than to walk the whole list forward. Signed-off-by: Paulo Zanoni Reviewed-by: Niranjana Vishwanathapura Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/xe/xe_vm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index ae5578a3e1219..b61ed51b503da 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -3118,8 +3118,7 @@ static int vm_bind_ioctl_ops_execute(struct xe_vm *vm, lockdep_assert_held_write(&vm->lock); - list_for_each_entry(op, ops_list, link) - last_op = op; + last_op = list_last_entry(ops_list, struct xe_vma_op, link); if (!async) { err = xe_vma_op_execute(vm, last_op); -- 2.30.2