ftrace: Pass retval through return in ftrace_dyn_arch_init()
authorJiri Slaby <jslaby@suse.cz>
Mon, 24 Feb 2014 18:59:58 +0000 (19:59 +0100)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 7 Mar 2014 15:06:13 +0000 (10:06 -0500)
No architecture uses the "data" parameter in ftrace_dyn_arch_init() in any
way, it just sets the value to 0. And this is used as a return value
in the caller -- ftrace_init, which just checks the retval against
zero.

Note there is also "return 0" in every ftrace_dyn_arch_init.  So it is
enough to check the retval and remove all the indirect sets of data on
all archs.

Link: http://lkml.kernel.org/r/1393268401-24379-3-git-send-email-jslaby@suse.cz
Cc: linux-arch@vger.kernel.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
14 files changed:
Documentation/trace/ftrace-design.txt
arch/arm/kernel/ftrace.c
arch/blackfin/kernel/ftrace.c
arch/ia64/kernel/ftrace.c
arch/metag/kernel/ftrace.c
arch/microblaze/kernel/ftrace.c
arch/mips/kernel/ftrace.c
arch/powerpc/kernel/ftrace.c
arch/s390/kernel/ftrace.c
arch/sh/kernel/ftrace.c
arch/sparc/kernel/ftrace.c
arch/tile/kernel/ftrace.c
arch/x86/kernel/ftrace.c
kernel/trace/ftrace.c

index 79fcafc..1171688 100644 (file)
@@ -360,9 +360,6 @@ function below should be sufficient for most people:
 
 int __init ftrace_dyn_arch_init(void *data)
 {
-       /* return value is done indirectly via data */
-       *(unsigned long *)data = 0;
-
        return 0;
 }
 
index 34e5664..5cd0d05 100644 (file)
@@ -158,8 +158,6 @@ int ftrace_make_nop(struct module *mod,
 
 int __init ftrace_dyn_arch_init(void *data)
 {
-       *(unsigned long *)data = 0;
-
        return 0;
 }
 #endif /* CONFIG_DYNAMIC_FTRACE */
index 9277905..f74c5ae 100644 (file)
@@ -67,9 +67,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
 
 int __init ftrace_dyn_arch_init(void *data)
 {
-       /* return value is done indirectly via data */
-       *(unsigned long *)data = 0;
-
        return 0;
 }
 
index 7fc8c96..cfaa93a 100644 (file)
@@ -200,7 +200,5 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
 /* run from kstop_machine */
 int __init ftrace_dyn_arch_init(void *data)
 {
-       *(unsigned long *)data = 0;
-
        return 0;
 }
index a774f32..bf59393 100644 (file)
@@ -119,8 +119,5 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
 /* run from kstop_machine */
 int __init ftrace_dyn_arch_init(void *data)
 {
-       /* The return code is returned via data */
-       writel(0, data);
-
        return 0;
 }
index e8a5e9c..ffa595c 100644 (file)
@@ -173,9 +173,6 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
 
 int __init ftrace_dyn_arch_init(void *data)
 {
-       /* The return code is retured via data */
-       *(unsigned long *)data = 0;
-
        return 0;
 }
 
index 185ba25..013016b 100644 (file)
@@ -206,9 +206,6 @@ int __init ftrace_dyn_arch_init(void *data)
        /* Remove "b ftrace_stub" to ensure ftrace_caller() is executed */
        ftrace_modify_code(MCOUNT_ADDR, INSN_NOP);
 
-       /* The return code is retured via data */
-       *(unsigned long *)data = 0;
-
        return 0;
 }
 #endif /* CONFIG_DYNAMIC_FTRACE */
index 9b27b29..d059664 100644 (file)
@@ -533,11 +533,6 @@ void arch_ftrace_update_code(int command)
 
 int __init ftrace_dyn_arch_init(void *data)
 {
-       /* caller expects data to be zero */
-       unsigned long *p = data;
-
-       *p = 0;
-
        return 0;
 }
 #endif /* CONFIG_DYNAMIC_FTRACE */
index 224db03..77b2f3a 100644 (file)
@@ -132,7 +132,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
 
 int __init ftrace_dyn_arch_init(void *data)
 {
-       *(unsigned long *) data = 0;
        return 0;
 }
 
index 30e1319..4939975 100644 (file)
@@ -274,9 +274,6 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
 
 int __init ftrace_dyn_arch_init(void *data)
 {
-       /* The return code is retured via data */
-       __raw_writel(0, (unsigned long)data);
-
        return 0;
 }
 #endif /* CONFIG_DYNAMIC_FTRACE */
index 03ab022..ee813b8 100644 (file)
@@ -84,10 +84,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
 
 int __init ftrace_dyn_arch_init(void *data)
 {
-       unsigned long *p = data;
-
-       *p = 0;
-
        return 0;
 }
 #endif
index f1c4520..34d9ea0 100644 (file)
@@ -169,8 +169,6 @@ int ftrace_make_nop(struct module *mod,
 
 int __init ftrace_dyn_arch_init(void *data)
 {
-       *(unsigned long *)data = 0;
-
        return 0;
 }
 #endif /* CONFIG_DYNAMIC_FTRACE */
index 8cabf63..bbe5a5b 100644 (file)
@@ -670,9 +670,6 @@ void arch_ftrace_update_code(int command)
 
 int __init ftrace_dyn_arch_init(void *data)
 {
-       /* The return code is retured via data */
-       *(unsigned long *)data = 0;
-
        return 0;
 }
 #endif
index 76b6ed2..083c6d5 100644 (file)
@@ -4379,11 +4379,9 @@ void __init ftrace_init(void)
        addr = (unsigned long)ftrace_stub;
 
        local_irq_save(flags);
-       ftrace_dyn_arch_init(&addr);
+       ret = ftrace_dyn_arch_init(&addr);
        local_irq_restore(flags);
-
-       /* ftrace_dyn_arch_init places the return code in addr */
-       if (addr)
+       if (ret)
                goto failed;
 
        count = __stop_mcount_loc - __start_mcount_loc;