[PATCH] binder: Use LIST_HEAD() to initialize on stack list head

Jisheng Zhang posted 1 patch 3 weeks, 1 day ago
drivers/android/binder.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
[PATCH] binder: Use LIST_HEAD() to initialize on stack list head
Posted by Jisheng Zhang 3 weeks, 1 day ago
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/android/binder.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 9e6194224593..ec0ab4f28530 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -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;
-- 
2.53.0