Skip to contentSkip to conversation

ftrace: Join functions ftrace_module_init and ftrace_init_module

PATCH Applied Abel Vesa 2 participants 2 messages Dec 2, 2015 – Dec 23, 2015

Subsystems (2)
lore
Share & tools
lore

Abel Vesa

author
#0 lore raw

PATCH 1/1 ftrace: Join functions ftrace_module_init and ftrace_init_module

Simple cleanup. No need for two functions here.
The whole work can simply be done inside 'ftrace_module_init'.

---
 kernel/trace/ftrace.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
kernel/trace/ftrace.c +6 -9
index e371aed..f558195 100644
@@ -5008,19 +5008,16 @@ void ftrace_release_mod(struct module *mod)
 	mutex_unlock(&ftrace_lock);
 }
 
-static void ftrace_init_module(struct module *mod,
-			       unsigned long *start, unsigned long *end)
+void ftrace_module_init(struct module *mod)
 {
+	unsigned long *start = mod->ftrace_callsites;
+	unsigned long *end = mod->ftrace_callsites +
+				mod->num_ftrace_callsites;
+
 	if (ftrace_disabled || start == end)
 		return;
-	ftrace_process_locs(mod, start, end);
-}
 
-void ftrace_module_init(struct module *mod)
-{
-	ftrace_init_module(mod, mod->ftrace_callsites,
-			   mod->ftrace_callsites +
-			   mod->num_ftrace_callsites);
+	ftrace_process_locs(mod, start, end);
 }
 
 static int ftrace_module_notify_exit(struct notifier_block *self,
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw
Quoted 2 lines · On Wed, 2 Dec 2015 15:39:57 +0100 Abel Vesa <[email protected]> wrote:

Simple cleanup. No need for two functions here.
The whole work can simply be done inside 'ftrace_module_init'.

Thanks! Applied.

-- Steve