mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rakib Mullick <rakib.mullick@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH] ftrace: Add missing __init in ftrace_profile_debugfs()
Date: Sun, 12 Jul 2009 16:58:18 +0600	[thread overview]
Message-ID: <b9df5fa10907120358t7101511cle30e025c3adcbe54@mail.gmail.com> (raw)

 Impact: Fix section mismatch.

The function ftrace_profile_debugfs() references a variable placed in
.init.data section. Thus causes a section mismatch warning. Since
ftrace_profile_debugfs() has been called from only
ftrace_init_debugfs, so we can safely mark ftrace_profile_debugfs as
init. Also it contains a trivial style fix, __init should be placed
between function type and function name (ftrace_init_debugfs).

We were warned by the following warning:

 LD      kernel/trace/libftrace.o
WARNING: kernel/trace/libftrace.o(.text+0xff0): Section mismatch in
reference from the function ftrace_profile_debugfs() to the variable
.init.data:function_stats
The function ftrace_profile_debugfs() references
the variable __initdata function_stats.
This is often because ftrace_profile_debugfs lacks a __initdata
annotation or the annotation of function_stats is wrong.


---
Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>

--- linus/kernel/trace/ftrace.c	2009-07-11 20:54:13.000000000 +0600
+++ rakib/kernel/trace/ftrace.c	2009-07-12 12:21:54.000000000 +0600
@@ -768,7 +768,7 @@ static struct tracer_stat function_stats
 	.stat_show	= function_stat_show
 };

-static void ftrace_profile_debugfs(struct dentry *d_tracer)
+static void __init ftrace_profile_debugfs(struct dentry *d_tracer)
 {
 	struct ftrace_profile_stat *stat;
 	struct dentry *entry;
@@ -813,7 +813,7 @@ static void ftrace_profile_debugfs(struc
 }

 #else /* CONFIG_FUNCTION_PROFILER */
-static void ftrace_profile_debugfs(struct dentry *d_tracer)
+static void __init ftrace_profile_debugfs(struct dentry *d_tracer)
 {
 }
 #endif /* CONFIG_FUNCTION_PROFILER */
@@ -3068,7 +3068,7 @@ static const struct file_operations ftra
 	.write = ftrace_pid_write,
 };

-static __init int ftrace_init_debugfs(void)
+static int __init ftrace_init_debugfs(void)
 {
 	struct dentry *d_tracer;

             reply	other threads:[~2009-07-12 10:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-12 10:58 Rakib Mullick [this message]
2009-07-13  0:47 ` Li Zefan
2009-07-13  3:58   ` Rakib Mullick
2009-07-13  9:01     ` 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=b9df5fa10907120358t7101511cle30e025c3adcbe54@mail.gmail.com \
    --to=rakib.mullick@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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

all inboxes | Powered by JetHome®