ftrace: Use LIST_HEAD to initialize clear_hash
authorRuan Jinjie <ruanjinjie@huawei.com>
Wed, 9 Aug 2023 07:15:51 +0000 (15:15 +0800)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Sat, 2 Sep 2023 01:18:38 +0000 (21:18 -0400)
Use LIST_HEAD() to initialize clear_hash instead of open-coding it.

Link: https://lore.kernel.org/linux-trace-kernel/20230809071551.913041-1-ruanjinjie@huawei.com
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ftrace.c

index c46dd6d97afef06cb2e2532e7cc84335458a17e1..8de8bec5f366404a06941885cfeedfd41facfeba 100644 (file)
@@ -7140,9 +7140,7 @@ void ftrace_free_mem(struct module *mod, void *start_ptr, void *end_ptr)
        struct dyn_ftrace key;
        struct ftrace_mod_map *mod_map = NULL;
        struct ftrace_init_func *func, *func_next;
-       struct list_head clear_hash;
-
-       INIT_LIST_HEAD(&clear_hash);
+       LIST_HEAD(clear_hash);
 
        key.ip = start;
        key.flags = end;        /* overload flags, as it is unsigned long */