2022-05-14 00:46:43

by Li Qiong

[permalink] [raw]
Subject: [PATCH] kernel/trace: cleanup code, remove init "char *name"

The pointer is assigned to "type->name" anyway. no need to
initialize with "preemption".

Signed-off-by: liqiong <[email protected]>
---
kernel/trace/trace.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 64649990a66a..d511581cfafd 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4273,9 +4273,7 @@ print_trace_header(struct seq_file *m, struct trace_iterator *iter)
struct tracer *type = iter->trace;
unsigned long entries;
unsigned long total;
- const char *name = "preemption";
-
- name = type->name;
+ const char *name = type->name;

get_total_entries(buf, &total, &entries);

--
2.25.1