* [PATCH] accel: Use LIST_HEAD() to initialize on stack list head
@ 2026-05-19 5:52 Jisheng Zhang
0 siblings, 0 replies; only message in thread
From: Jisheng Zhang @ 2026-05-19 5:52 UTC (permalink / raw)
To: Koby Elbaz, Konstantin Sinyuk, Oded Gabbay, Maciej Falkowski,
Karol Wachowski
Cc: dri-devel, linux-kernel
Use LIST_HEAD to initialize on stack list head. No intentional
functional impact.
Change generated with below coccinelle script:
@@
identifier name;
@@
- struct list_head name;
+ LIST_HEAD(name);
... when != name
- INIT_LIST_HEAD(&name);
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/accel/habanalabs/common/memory.c | 4 +---
drivers/accel/ivpu/ivpu_ipc.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/accel/habanalabs/common/memory.c b/drivers/accel/habanalabs/common/memory.c
index 361cff577381..0e47e243ce42 100644
--- a/drivers/accel/habanalabs/common/memory.c
+++ b/drivers/accel/habanalabs/common/memory.c
@@ -2752,7 +2752,7 @@ void hl_vm_ctx_fini(struct hl_ctx *ctx)
struct hl_vm_hash_node *hnode;
struct hl_vm *vm = &hdev->vm;
struct hlist_node *tmp_node;
- struct list_head free_list;
+ LIST_HEAD(free_list);
struct hl_mem_in args;
int i;
@@ -2785,8 +2785,6 @@ void hl_vm_ctx_fini(struct hl_ctx *ctx)
mutex_unlock(&hdev->mmu_lock);
- INIT_LIST_HEAD(&free_list);
-
spin_lock(&vm->idr_lock);
idr_for_each_entry(&vm->phys_pg_pack_handles, phys_pg_list, i)
if (phys_pg_list->asid == ctx->asid) {
diff --git a/drivers/accel/ivpu/ivpu_ipc.c b/drivers/accel/ivpu/ivpu_ipc.c
index f47df092bb0d..74f5afe5be46 100644
--- a/drivers/accel/ivpu/ivpu_ipc.c
+++ b/drivers/accel/ivpu/ivpu_ipc.c
@@ -467,9 +467,7 @@ void ivpu_ipc_irq_work_fn(struct work_struct *work)
struct ivpu_device *vdev = container_of(work, struct ivpu_device, irq_ipc_work);
struct ivpu_ipc_info *ipc = vdev->ipc;
struct ivpu_ipc_rx_msg *rx_msg, *r;
- struct list_head cb_msg_list;
-
- INIT_LIST_HEAD(&cb_msg_list);
+ LIST_HEAD(cb_msg_list);
spin_lock_irq(&ipc->cons_lock);
list_splice_tail_init(&ipc->cb_msg_list, &cb_msg_list);
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-19 6:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-19 5:52 [PATCH] accel: Use LIST_HEAD() to initialize on stack list head Jisheng Zhang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.