From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Matt Fleming <mjf@gentoo.org>,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
Sam Ravnborg <sam@ravnborg.org>,
Jim Radford <radford@galvanix.net>,
Paul Mundt <lethal@linux-sh.org>,
Steven Rostedt <srostedt@redhat.com>
Subject: [PATCH 5/5] trace: fix compiler warning in branch profiler
Date: Fri, 21 Nov 2008 15:29:37 -0500 [thread overview]
Message-ID: <20081121203101.099886994@goodmis.org> (raw)
In-Reply-To: <20081121202932.281682721@goodmis.org>
[-- Attachment #1: 0005-trace-fix-compiler-warning-in-branch-profiler.patch --]
[-- Type: text/plain, Size: 2461 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
Impact: fix complier warning
The ftrace_pointers used in the branch profiler are constant values.
They should never change. But the compiler complains when they are
passed into the debugfs_create_file as a data pointer, because the
function discards the qualifier.
This patch typecasts the parameter to debugfs_create_file back to
a void pointer. To remind the callbacks that they are pointing to
a constant value, I also modified the callback local pointers to
be const struct ftrace_pointer * as well.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
kernel/trace/trace_branch.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c
index 85792ae..877ee88 100644
--- a/kernel/trace/trace_branch.c
+++ b/kernel/trace/trace_branch.c
@@ -191,7 +191,7 @@ struct ftrace_pointer {
static void *
t_next(struct seq_file *m, void *v, loff_t *pos)
{
- struct ftrace_pointer *f = m->private;
+ const struct ftrace_pointer *f = m->private;
struct ftrace_branch_data *p = v;
(*pos)++;
@@ -224,7 +224,7 @@ static void t_stop(struct seq_file *m, void *p)
static int t_show(struct seq_file *m, void *v)
{
- struct ftrace_pointer *fp = m->private;
+ const struct ftrace_pointer *fp = m->private;
struct ftrace_branch_data *p = v;
const char *f;
long percent;
@@ -296,7 +296,7 @@ static const struct file_operations tracing_branch_fops = {
extern unsigned long __start_branch_profile[];
extern unsigned long __stop_branch_profile[];
-static struct ftrace_pointer ftrace_branch_pos = {
+static const struct ftrace_pointer ftrace_branch_pos = {
.start = __start_branch_profile,
.stop = __stop_branch_profile,
.hit = 1,
@@ -320,7 +320,7 @@ static __init int ftrace_branch_init(void)
d_tracer = tracing_init_dentry();
entry = debugfs_create_file("profile_annotated_branch", 0444, d_tracer,
- &ftrace_annotated_branch_pos,
+ (void *)&ftrace_annotated_branch_pos,
&tracing_branch_fops);
if (!entry)
pr_warning("Could not create debugfs "
@@ -328,7 +328,7 @@ static __init int ftrace_branch_init(void)
#ifdef CONFIG_PROFILE_ALL_BRANCHES
entry = debugfs_create_file("profile_branch", 0444, d_tracer,
- &ftrace_branch_pos,
+ (void *)&ftrace_branch_pos,
&tracing_branch_fops);
if (!entry)
pr_warning("Could not create debugfs"
--
1.5.6.5
--
next prev parent reply other threads:[~2008-11-21 20:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-21 20:29 [PATCH 0/5] ftrace: recordmcount for sh and arm, plus permanent disable API Steven Rostedt
2008-11-21 20:29 ` [PATCH 1/5] ftrace: Specify $alignment for sh architecture Steven Rostedt
2008-11-21 20:29 ` [PATCH 2/5] ftrace: mcountrecord.pl for arm Steven Rostedt
2008-11-21 20:29 ` [PATCH 3/5] ring-buffer: add tracing_off_permanent Steven Rostedt
2008-11-21 20:29 ` [PATCH 4/5] ftrace: add ftrace_off_permanent Steven Rostedt
2008-11-21 20:29 ` Steven Rostedt [this message]
2008-11-23 10:51 ` [PATCH 0/5] ftrace: recordmcount for sh and arm, plus permanent disable API Ingo Molnar
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=20081121203101.099886994@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mingo@elte.hu \
--cc=mjf@gentoo.org \
--cc=radford@galvanix.net \
--cc=sam@ravnborg.org \
--cc=srostedt@redhat.com \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®