[PATCH] trace_osnoise: rename main to trace_main to avoid Werror=main

From: Jackie Liu
Date: Mon Sep 06 2021 - 05:40:41 EST


From: Jackie Liu <liuyun01@xxxxxxxxxx>

kernel builds with -Werror=main, gcc report failed.

Avoids warnings like:
kernel/trace/trace_osnoise.c:1515:8: error: ‘main’ is usually a function [-Werror=main]

Fixes: a955d7eac177 ("trace: Add timerlat tracer")
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Signed-off-by: Jackie Liu <liuyun01@xxxxxxxxxx>
---
kernel/trace/trace_osnoise.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index b61eefe5ccf5..938e2791010a 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -1512,20 +1512,20 @@ static void stop_per_cpu_kthreads(void)
static int start_kthread(unsigned int cpu)
{
struct task_struct *kthread;
- void *main = osnoise_main;
+ void *trace_main = osnoise_main;
char comm[24];

#ifdef CONFIG_TIMERLAT_TRACER
if (osnoise_data.timerlat_tracer) {
snprintf(comm, 24, "timerlat/%d", cpu);
- main = timerlat_main;
+ trace_main = timerlat_main;
} else {
snprintf(comm, 24, "osnoise/%d", cpu);
}
#else
snprintf(comm, 24, "osnoise/%d", cpu);
#endif
- kthread = kthread_create_on_cpu(main, NULL, cpu, comm);
+ kthread = kthread_create_on_cpu(trace_main, NULL, cpu, comm);

if (IS_ERR(kthread)) {
pr_err(BANNER "could not start sampling thread\n");
--
2.25.1