]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
binder: Use LIST_HEAD() to initialize on stack list head
authorJisheng Zhang <jszhang@kernel.org>
Tue, 19 May 2026 05:56:23 +0000 (13:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 May 2026 11:47:32 +0000 (13:47 +0200)
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>
Link: https://patch.msgid.link/20260519055623.13142-1-jszhang@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder.c

index 9e61942245936807fcb4ee1b6187b96def7b1611..ec0ab4f285301452b1b90a2b3b43e2cc9893284e 100644 (file)
@@ -3080,12 +3080,10 @@ static void binder_transaction(struct binder_proc *proc,
        int t_debug_id = atomic_inc_return(&binder_last_id);
        ktime_t t_start_time = ktime_get();
        struct lsm_context lsmctx = { };
-       struct list_head sgc_head;
-       struct list_head pf_head;
+       LIST_HEAD(sgc_head);
+       LIST_HEAD(pf_head);
        const void __user *user_buffer = (const void __user *)
                                (uintptr_t)tr->data.ptr.buffer;
-       INIT_LIST_HEAD(&sgc_head);
-       INIT_LIST_HEAD(&pf_head);
 
        e = binder_transaction_log_add(&binder_transaction_log);
        e->debug_id = t_debug_id;