From: Jackie Liu <liu.yun@linux.dev>
To: rostedt@goodmis.org, mingo@redhat.com
Cc: linux-kernel@vger.kernel.org, liu.yun@linux.dev
Subject: [PATCH] trace_osnoise: rename main to trace_main to avoid Werror=main
Date: Mon, 6 Sep 2021 17:40:03 +0800 [thread overview]
Message-ID: <20210906094003.948975-1-liu.yun@linux.dev> (raw)
From: Jackie Liu <liuyun01@kylinos.cn>
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@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
---
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
next reply other threads:[~2021-09-06 9:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-06 9:40 Jackie Liu [this message]
2021-09-06 11:56 ` [PATCH] trace_osnoise: rename main to trace_main to avoid Werror=main Steven Rostedt
2021-09-06 13:17 ` Jackie Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210906094003.948975-1-liu.yun@linux.dev \
--to=liu.yun@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox