]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ftrace: Remove return value of ftrace_arch_modify_*()
authorLi kunyu <kunyu@nfschina.com>
Wed, 18 May 2022 02:36:40 +0000 (10:36 +0800)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 27 May 2022 01:13:00 +0000 (21:13 -0400)
All instances of the function ftrace_arch_modify_prepare() and
  ftrace_arch_modify_post_process() return zero. There's no point in
  checking their return value. Just have them be void functions.

Link: https://lkml.kernel.org/r/20220518023639.4065-1-kunyu@nfschina.com
Signed-off-by: Li kunyu <kunyu@nfschina.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
arch/arm/kernel/ftrace.c
arch/riscv/kernel/ftrace.c
arch/s390/kernel/ftrace.c
arch/x86/kernel/ftrace.c
include/linux/ftrace.h
kernel/trace/ftrace.c

index 83cc068586bc5c25dbb2e63cc2378229f43c801f..a0b6d1e3812fdba8f25aa4b59406044904150526 100644 (file)
@@ -79,16 +79,14 @@ static unsigned long __ref adjust_address(struct dyn_ftrace *rec,
        return (unsigned long)&ftrace_regs_caller_from_init;
 }
 
-int ftrace_arch_code_modify_prepare(void)
+void ftrace_arch_code_modify_prepare(void)
 {
-       return 0;
 }
 
-int ftrace_arch_code_modify_post_process(void)
+void ftrace_arch_code_modify_post_process(void)
 {
        /* Make sure any TLB misses during machine stop are cleared. */
        flush_tlb_all();
-       return 0;
 }
 
 static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr,
index 4716f4cdc03804ed944d707910594ff565b50de9..2086f65857737300db14d24b17b0439e9f182069 100644 (file)
 #include <asm/patch.h>
 
 #ifdef CONFIG_DYNAMIC_FTRACE
-int ftrace_arch_code_modify_prepare(void) __acquires(&text_mutex)
+void ftrace_arch_code_modify_prepare(void) __acquires(&text_mutex)
 {
        mutex_lock(&text_mutex);
-       return 0;
 }
 
-int ftrace_arch_code_modify_post_process(void) __releases(&text_mutex)
+void ftrace_arch_code_modify_post_process(void) __releases(&text_mutex)
 {
        mutex_unlock(&text_mutex);
-       return 0;
 }
 
 static int ftrace_check_current_call(unsigned long hook_pos,
index 1852d46babb1552b3d504e9c48d669c70941d33e..416b5a94353db0a45174f8f21f55c85e39b07c25 100644 (file)
@@ -225,14 +225,13 @@ void arch_ftrace_update_code(int command)
        ftrace_modify_all_code(command);
 }
 
-int ftrace_arch_code_modify_post_process(void)
+void ftrace_arch_code_modify_post_process(void)
 {
        /*
         * Flush any pre-fetched instructions on all
         * CPUs to make the new code visible.
         */
        text_poke_sync_lock();
-       return 0;
 }
 
 #ifdef CONFIG_MODULES
index 1e31c7d21597bf56ce021793c2bcdb2ddf37b653..73d2719ed12c438ce5403f1eff6b925b6f575519 100644 (file)
@@ -37,7 +37,7 @@
 
 static int ftrace_poke_late = 0;
 
-int ftrace_arch_code_modify_prepare(void)
+void ftrace_arch_code_modify_prepare(void)
     __acquires(&text_mutex)
 {
        /*
@@ -47,10 +47,9 @@ int ftrace_arch_code_modify_prepare(void)
         */
        mutex_lock(&text_mutex);
        ftrace_poke_late = 1;
-       return 0;
 }
 
-int ftrace_arch_code_modify_post_process(void)
+void ftrace_arch_code_modify_post_process(void)
     __releases(&text_mutex)
 {
        /*
@@ -61,7 +60,6 @@ int ftrace_arch_code_modify_post_process(void)
        text_poke_finish();
        ftrace_poke_late = 0;
        mutex_unlock(&text_mutex);
-       return 0;
 }
 
 static const char *ftrace_nop_replace(void)
index 4816b7e110472c06063dec6d67cac1c5419e2a6b..a5f74f6e7e4e8799e98b33f93a8521d41f82ffd2 100644 (file)
@@ -449,8 +449,8 @@ static inline void stack_tracer_enable(void) { }
 
 #ifdef CONFIG_DYNAMIC_FTRACE
 
-int ftrace_arch_code_modify_prepare(void);
-int ftrace_arch_code_modify_post_process(void);
+void ftrace_arch_code_modify_prepare(void);
+void ftrace_arch_code_modify_post_process(void);
 
 enum ftrace_bug_type {
        FTRACE_BUG_UNKNOWN,
index 737e895e2aad6f39caf73181622f9022b926984c..852c731cbd9a2ac405e7d3d6d13a5a58c6a7b235 100644 (file)
@@ -2704,18 +2704,16 @@ ftrace_nop_initialize(struct module *mod, struct dyn_ftrace *rec)
  * archs can override this function if they must do something
  * before the modifying code is performed.
  */
-int __weak ftrace_arch_code_modify_prepare(void)
+void __weak ftrace_arch_code_modify_prepare(void)
 {
-       return 0;
 }
 
 /*
  * archs can override this function if they must do something
  * after the modifying code is performed.
  */
-int __weak ftrace_arch_code_modify_post_process(void)
+void __weak ftrace_arch_code_modify_post_process(void)
 {
-       return 0;
 }
 
 void ftrace_modify_all_code(int command)
@@ -2801,12 +2799,7 @@ void __weak arch_ftrace_update_code(int command)
 
 static void ftrace_run_update_code(int command)
 {
-       int ret;
-
-       ret = ftrace_arch_code_modify_prepare();
-       FTRACE_WARN_ON(ret);
-       if (ret)
-               return;
+       ftrace_arch_code_modify_prepare();
 
        /*
         * By default we use stop_machine() to modify the code.
@@ -2816,8 +2809,7 @@ static void ftrace_run_update_code(int command)
         */
        arch_ftrace_update_code(command);
 
-       ret = ftrace_arch_code_modify_post_process();
-       FTRACE_WARN_ON(ret);
+       ftrace_arch_code_modify_post_process();
 }
 
 static void ftrace_run_modify_code(struct ftrace_ops *ops, int command,