All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ftrace: Statically initialize pm notifier block
@ 2014-03-30 13:31 Mathias Krause
  2014-04-03 16:34 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Mathias Krause @ 2014-03-30 13:31 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Frederic Weisbecker, Ingo Molnar, linux-kernel, Mathias Krause, PaX Team

Instead of initializing the pm notifier block in register_ftrace_graph(),
initialize it statically. This safes us some code.

Found in the PaX patch, written by the PaX Team.

Cc: PaX Team <pageexec@freemail.hu>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
 kernel/trace/ftrace.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index cd7f76d1eb..a4d74eb000 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -4909,7 +4909,6 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 
 static int ftrace_graph_active;
-static struct notifier_block ftrace_suspend_notifier;
 
 int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace)
 {
@@ -5086,6 +5085,10 @@ static void update_function_graph_func(void)
 		ftrace_graph_entry = ftrace_graph_entry_test;
 }
 
+static struct notifier_block ftrace_suspend_notifier = {
+	.notifier_call = ftrace_suspend_notifier_call,
+};
+
 int register_ftrace_graph(trace_func_graph_ret_t retfunc,
 			trace_func_graph_ent_t entryfunc)
 {
@@ -5099,7 +5102,6 @@ int register_ftrace_graph(trace_func_graph_ret_t retfunc,
 		goto out;
 	}
 
-	ftrace_suspend_notifier.notifier_call = ftrace_suspend_notifier_call;
 	register_pm_notifier(&ftrace_suspend_notifier);
 
 	ftrace_graph_active++;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ftrace: Statically initialize pm notifier block
  2014-03-30 13:31 [PATCH] ftrace: Statically initialize pm notifier block Mathias Krause
@ 2014-04-03 16:34 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2014-04-03 16:34 UTC (permalink / raw)
  To: Mathias Krause; +Cc: Frederic Weisbecker, Ingo Molnar, linux-kernel, PaX Team

On Sun, 30 Mar 2014 15:31:50 +0200
Mathias Krause <minipli@googlemail.com> wrote:

> Instead of initializing the pm notifier block in register_ftrace_graph(),
> initialize it statically. This safes us some code.
> 
> Found in the PaX patch, written by the PaX Team.
> 
> Cc: PaX Team <pageexec@freemail.hu>
> Signed-off-by: Mathias Krause <minipli@googlemail.com>
> ---

I'll queue this up for 3.16.

Thanks,

-- Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-03 16:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-30 13:31 [PATCH] ftrace: Statically initialize pm notifier block Mathias Krause
2014-04-03 16:34 ` Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.