Skip to contentSkip to conversation

ftrace: Statically initialize pm notifier block

PATCH In review Mathias Krause 2 participants 2 messages Mar 30, 2014 – Apr 3, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ftrace: Statically initialize pm notifier block

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.

---
 kernel/trace/ftrace.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/trace/ftrace.c +4 -2
index cd7f76d1eb..a4d74eb000 100644
@@ -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++;
Signature · 1 line
1.7.10.4