diff options
author | Jiri Slaby <jslaby@suse.cz> | 2014-02-24 13:59:58 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-03-07 10:06:13 -0500 |
commit | af64a7cb09db77344c596a0bf3d57d77257e8bf5 (patch) | |
tree | 9bfca2ea8870ed23eb49dca85303ec49752217a7 | |
parent | c867ccd8388d1c1a31bef9c54544b2ef32f0ebca (diff) |
ftrace: Pass retval through return in ftrace_dyn_arch_init()
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>
-rw-r--r-- | Documentation/trace/ftrace-design.txt | 3 | ||||
-rw-r--r-- | arch/arm/kernel/ftrace.c | 2 | ||||
-rw-r--r-- | arch/blackfin/kernel/ftrace.c | 3 | ||||
-rw-r--r-- | arch/ia64/kernel/ftrace.c | 2 | ||||
-rw-r--r-- | arch/metag/kernel/ftrace.c | 3 | ||||
-rw-r--r-- | arch/microblaze/kernel/ftrace.c | 3 | ||||
-rw-r--r-- | arch/mips/kernel/ftrace.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/ftrace.c | 5 | ||||
-rw-r--r-- | arch/s390/kernel/ftrace.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/ftrace.c | 3 | ||||
-rw-r--r-- | arch/sparc/kernel/ftrace.c | 4 | ||||
-rw-r--r-- | arch/tile/kernel/ftrace.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/ftrace.c | 3 | ||||
-rw-r--r-- | kernel/trace/ftrace.c | 6 |
14 files changed, 2 insertions, 41 deletions
diff --git a/Documentation/trace/ftrace-design.txt b/Documentation/trace/ftrace-design.txt index 79fcafc7fd64..117168884023 100644 --- a/Documentation/trace/ftrace-design.txt +++ b/Documentation/trace/ftrace-design.txt | |||
@@ -360,9 +360,6 @@ function below should be sufficient for most people: | |||
360 | 360 | ||
361 | int __init ftrace_dyn_arch_init(void *data) | 361 | int __init ftrace_dyn_arch_init(void *data) |
362 | { | 362 | { |
363 | /* return value is done indirectly via data */ | ||
364 | *(unsigned long *)data = 0; | ||
365 | |||
366 | return 0; | 363 | return 0; |
367 | } | 364 | } |
368 | 365 | ||
diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c index 34e56647dcee..5cd0d05edf35 100644 --- a/arch/arm/kernel/ftrace.c +++ b/arch/arm/kernel/ftrace.c | |||
@@ -158,8 +158,6 @@ int ftrace_make_nop(struct module *mod, | |||
158 | 158 | ||
159 | int __init ftrace_dyn_arch_init(void *data) | 159 | int __init ftrace_dyn_arch_init(void *data) |
160 | { | 160 | { |
161 | *(unsigned long *)data = 0; | ||
162 | |||
163 | return 0; | 161 | return 0; |
164 | } | 162 | } |
165 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 163 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
diff --git a/arch/blackfin/kernel/ftrace.c b/arch/blackfin/kernel/ftrace.c index 9277905b82cf..f74c5ae6a25b 100644 --- a/arch/blackfin/kernel/ftrace.c +++ b/arch/blackfin/kernel/ftrace.c | |||
@@ -67,9 +67,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func) | |||
67 | 67 | ||
68 | int __init ftrace_dyn_arch_init(void *data) | 68 | int __init ftrace_dyn_arch_init(void *data) |
69 | { | 69 | { |
70 | /* return value is done indirectly via data */ | ||
71 | *(unsigned long *)data = 0; | ||
72 | |||
73 | return 0; | 70 | return 0; |
74 | } | 71 | } |
75 | 72 | ||
diff --git a/arch/ia64/kernel/ftrace.c b/arch/ia64/kernel/ftrace.c index 7fc8c961b1f7..cfaa93a8bbdf 100644 --- a/arch/ia64/kernel/ftrace.c +++ b/arch/ia64/kernel/ftrace.c | |||
@@ -200,7 +200,5 @@ int ftrace_update_ftrace_func(ftrace_func_t func) | |||
200 | /* run from kstop_machine */ | 200 | /* run from kstop_machine */ |
201 | int __init ftrace_dyn_arch_init(void *data) | 201 | int __init ftrace_dyn_arch_init(void *data) |
202 | { | 202 | { |
203 | *(unsigned long *)data = 0; | ||
204 | |||
205 | return 0; | 203 | return 0; |
206 | } | 204 | } |
diff --git a/arch/metag/kernel/ftrace.c b/arch/metag/kernel/ftrace.c index a774f321643f..bf593932b353 100644 --- a/arch/metag/kernel/ftrace.c +++ b/arch/metag/kernel/ftrace.c | |||
@@ -119,8 +119,5 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) | |||
119 | /* run from kstop_machine */ | 119 | /* run from kstop_machine */ |
120 | int __init ftrace_dyn_arch_init(void *data) | 120 | int __init ftrace_dyn_arch_init(void *data) |
121 | { | 121 | { |
122 | /* The return code is returned via data */ | ||
123 | writel(0, data); | ||
124 | |||
125 | return 0; | 122 | return 0; |
126 | } | 123 | } |
diff --git a/arch/microblaze/kernel/ftrace.c b/arch/microblaze/kernel/ftrace.c index e8a5e9cf4ed1..ffa595c7fec2 100644 --- a/arch/microblaze/kernel/ftrace.c +++ b/arch/microblaze/kernel/ftrace.c | |||
@@ -173,9 +173,6 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) | |||
173 | 173 | ||
174 | int __init ftrace_dyn_arch_init(void *data) | 174 | int __init ftrace_dyn_arch_init(void *data) |
175 | { | 175 | { |
176 | /* The return code is retured via data */ | ||
177 | *(unsigned long *)data = 0; | ||
178 | |||
179 | return 0; | 176 | return 0; |
180 | } | 177 | } |
181 | 178 | ||
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c index 185ba258361b..013016bec9e1 100644 --- a/arch/mips/kernel/ftrace.c +++ b/arch/mips/kernel/ftrace.c | |||
@@ -206,9 +206,6 @@ int __init ftrace_dyn_arch_init(void *data) | |||
206 | /* Remove "b ftrace_stub" to ensure ftrace_caller() is executed */ | 206 | /* Remove "b ftrace_stub" to ensure ftrace_caller() is executed */ |
207 | ftrace_modify_code(MCOUNT_ADDR, INSN_NOP); | 207 | ftrace_modify_code(MCOUNT_ADDR, INSN_NOP); |
208 | 208 | ||
209 | /* The return code is retured via data */ | ||
210 | *(unsigned long *)data = 0; | ||
211 | |||
212 | return 0; | 209 | return 0; |
213 | } | 210 | } |
214 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 211 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index 9b27b293a922..d059664cdf16 100644 --- a/arch/powerpc/kernel/ftrace.c +++ b/arch/powerpc/kernel/ftrace.c | |||
@@ -533,11 +533,6 @@ void arch_ftrace_update_code(int command) | |||
533 | 533 | ||
534 | int __init ftrace_dyn_arch_init(void *data) | 534 | int __init ftrace_dyn_arch_init(void *data) |
535 | { | 535 | { |
536 | /* caller expects data to be zero */ | ||
537 | unsigned long *p = data; | ||
538 | |||
539 | *p = 0; | ||
540 | |||
541 | return 0; | 536 | return 0; |
542 | } | 537 | } |
543 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 538 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c index 224db03e9518..77b2f3a1f50a 100644 --- a/arch/s390/kernel/ftrace.c +++ b/arch/s390/kernel/ftrace.c | |||
@@ -132,7 +132,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func) | |||
132 | 132 | ||
133 | int __init ftrace_dyn_arch_init(void *data) | 133 | int __init ftrace_dyn_arch_init(void *data) |
134 | { | 134 | { |
135 | *(unsigned long *) data = 0; | ||
136 | return 0; | 135 | return 0; |
137 | } | 136 | } |
138 | 137 | ||
diff --git a/arch/sh/kernel/ftrace.c b/arch/sh/kernel/ftrace.c index 30e13196d35b..493997541d2c 100644 --- a/arch/sh/kernel/ftrace.c +++ b/arch/sh/kernel/ftrace.c | |||
@@ -274,9 +274,6 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) | |||
274 | 274 | ||
275 | int __init ftrace_dyn_arch_init(void *data) | 275 | int __init ftrace_dyn_arch_init(void *data) |
276 | { | 276 | { |
277 | /* The return code is retured via data */ | ||
278 | __raw_writel(0, (unsigned long)data); | ||
279 | |||
280 | return 0; | 277 | return 0; |
281 | } | 278 | } |
282 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 279 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
diff --git a/arch/sparc/kernel/ftrace.c b/arch/sparc/kernel/ftrace.c index 03ab022e51c5..ee813b82da49 100644 --- a/arch/sparc/kernel/ftrace.c +++ b/arch/sparc/kernel/ftrace.c | |||
@@ -84,10 +84,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func) | |||
84 | 84 | ||
85 | int __init ftrace_dyn_arch_init(void *data) | 85 | int __init ftrace_dyn_arch_init(void *data) |
86 | { | 86 | { |
87 | unsigned long *p = data; | ||
88 | |||
89 | *p = 0; | ||
90 | |||
91 | return 0; | 87 | return 0; |
92 | } | 88 | } |
93 | #endif | 89 | #endif |
diff --git a/arch/tile/kernel/ftrace.c b/arch/tile/kernel/ftrace.c index f1c452092eeb..34d9ea0bca9f 100644 --- a/arch/tile/kernel/ftrace.c +++ b/arch/tile/kernel/ftrace.c | |||
@@ -169,8 +169,6 @@ int ftrace_make_nop(struct module *mod, | |||
169 | 169 | ||
170 | int __init ftrace_dyn_arch_init(void *data) | 170 | int __init ftrace_dyn_arch_init(void *data) |
171 | { | 171 | { |
172 | *(unsigned long *)data = 0; | ||
173 | |||
174 | return 0; | 172 | return 0; |
175 | } | 173 | } |
176 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 174 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 8cabf638cb63..bbe5a5b88aad 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -670,9 +670,6 @@ void arch_ftrace_update_code(int command) | |||
670 | 670 | ||
671 | int __init ftrace_dyn_arch_init(void *data) | 671 | int __init ftrace_dyn_arch_init(void *data) |
672 | { | 672 | { |
673 | /* The return code is retured via data */ | ||
674 | *(unsigned long *)data = 0; | ||
675 | |||
676 | return 0; | 673 | return 0; |
677 | } | 674 | } |
678 | #endif | 675 | #endif |
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 76b6ed29d856..083c6d5fce25 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -4379,11 +4379,9 @@ void __init ftrace_init(void) | |||
4379 | addr = (unsigned long)ftrace_stub; | 4379 | addr = (unsigned long)ftrace_stub; |
4380 | 4380 | ||
4381 | local_irq_save(flags); | 4381 | local_irq_save(flags); |
4382 | ftrace_dyn_arch_init(&addr); | 4382 | ret = ftrace_dyn_arch_init(&addr); |
4383 | local_irq_restore(flags); | 4383 | local_irq_restore(flags); |
4384 | 4384 | if (ret) | |
4385 | /* ftrace_dyn_arch_init places the return code in addr */ | ||
4386 | if (addr) | ||
4387 | goto failed; | 4385 | goto failed; |
4388 | 4386 | ||
4389 | count = __stop_mcount_loc - __start_mcount_loc; | 4387 | count = __stop_mcount_loc - __start_mcount_loc; |