diff options
author | Steven Rostedt <srostedt@redhat.com> | 2008-11-21 14:44:57 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-23 05:46:49 -0500 |
commit | 0429149fb5e01edc410648591c19095d2074ee00 (patch) | |
tree | d16c0e5b19f1d1409bc653ea12ba17938774ec64 | |
parent | 2bcd521a684cc94befbe2ce7d5b613c841b0d304 (diff) |
trace: fix compiler warning in branch profiler
Impact: fix compiler 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>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | 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 85792aec64d2..877ee88e6a74 100644 --- a/kernel/trace/trace_branch.c +++ b/kernel/trace/trace_branch.c | |||
@@ -191,7 +191,7 @@ struct ftrace_pointer { | |||
191 | static void * | 191 | static void * |
192 | t_next(struct seq_file *m, void *v, loff_t *pos) | 192 | t_next(struct seq_file *m, void *v, loff_t *pos) |
193 | { | 193 | { |
194 | struct ftrace_pointer *f = m->private; | 194 | const struct ftrace_pointer *f = m->private; |
195 | struct ftrace_branch_data *p = v; | 195 | struct ftrace_branch_data *p = v; |
196 | 196 | ||
197 | (*pos)++; | 197 | (*pos)++; |
@@ -224,7 +224,7 @@ static void t_stop(struct seq_file *m, void *p) | |||
224 | 224 | ||
225 | static int t_show(struct seq_file *m, void *v) | 225 | static int t_show(struct seq_file *m, void *v) |
226 | { | 226 | { |
227 | struct ftrace_pointer *fp = m->private; | 227 | const struct ftrace_pointer *fp = m->private; |
228 | struct ftrace_branch_data *p = v; | 228 | struct ftrace_branch_data *p = v; |
229 | const char *f; | 229 | const char *f; |
230 | long percent; | 230 | long percent; |
@@ -296,7 +296,7 @@ static const struct file_operations tracing_branch_fops = { | |||
296 | extern unsigned long __start_branch_profile[]; | 296 | extern unsigned long __start_branch_profile[]; |
297 | extern unsigned long __stop_branch_profile[]; | 297 | extern unsigned long __stop_branch_profile[]; |
298 | 298 | ||
299 | static struct ftrace_pointer ftrace_branch_pos = { | 299 | static const struct ftrace_pointer ftrace_branch_pos = { |
300 | .start = __start_branch_profile, | 300 | .start = __start_branch_profile, |
301 | .stop = __stop_branch_profile, | 301 | .stop = __stop_branch_profile, |
302 | .hit = 1, | 302 | .hit = 1, |
@@ -320,7 +320,7 @@ static __init int ftrace_branch_init(void) | |||
320 | d_tracer = tracing_init_dentry(); | 320 | d_tracer = tracing_init_dentry(); |
321 | 321 | ||
322 | entry = debugfs_create_file("profile_annotated_branch", 0444, d_tracer, | 322 | entry = debugfs_create_file("profile_annotated_branch", 0444, d_tracer, |
323 | &ftrace_annotated_branch_pos, | 323 | (void *)&ftrace_annotated_branch_pos, |
324 | &tracing_branch_fops); | 324 | &tracing_branch_fops); |
325 | if (!entry) | 325 | if (!entry) |
326 | pr_warning("Could not create debugfs " | 326 | pr_warning("Could not create debugfs " |
@@ -328,7 +328,7 @@ static __init int ftrace_branch_init(void) | |||
328 | 328 | ||
329 | #ifdef CONFIG_PROFILE_ALL_BRANCHES | 329 | #ifdef CONFIG_PROFILE_ALL_BRANCHES |
330 | entry = debugfs_create_file("profile_branch", 0444, d_tracer, | 330 | entry = debugfs_create_file("profile_branch", 0444, d_tracer, |
331 | &ftrace_branch_pos, | 331 | (void *)&ftrace_branch_pos, |
332 | &tracing_branch_fops); | 332 | &tracing_branch_fops); |
333 | if (!entry) | 333 | if (!entry) |
334 | pr_warning("Could not create debugfs" | 334 | pr_warning("Could not create debugfs" |