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
Showing the changes to kernel/trace (1 of 6 files). Show all
Unified · Split
| @@ -2704,18 +2704,16 @@ ftrace_nop_initialize(struct module *mod, struct dyn_ftrace *rec) · 2703 unmodified lines | ||
| 2704 | 2704 | * archs can override this function if they must do something |
| 2705 | 2705 | * before the modifying code is performed. |
| 2706 | 2706 | */ |
| 2707 | −int __weak ftrace_arch_code_modify_prepare(void) | |
| 2707 | +void __weak ftrace_arch_code_modify_prepare(void) | |
| 2708 | 2708 | { |
| 2709 | − return 0; | |
| 2710 | 2709 | } |
| 2711 | 2710 | |
| 2712 | 2711 | /* |
| 2713 | 2712 | * archs can override this function if they must do something |
| 2714 | 2713 | * after the modifying code is performed. |
| 2715 | 2714 | */ |
| 2716 | −int __weak ftrace_arch_code_modify_post_process(void) | |
| 2715 | +void __weak ftrace_arch_code_modify_post_process(void) | |
| 2717 | 2716 | { |
| 2718 | − return 0; | |
| 2719 | 2717 | } |
| 2720 | 2718 | |
| 2721 | 2719 | void ftrace_modify_all_code(int command) |
| @@ -2801,12 +2799,7 @@ void __weak arch_ftrace_update_code(int command) · 79 unmodified lines | ||
| 2801 | 2799 | |
| 2802 | 2800 | static void ftrace_run_update_code(int command) |
| 2803 | 2801 | { |
| 2804 | − int ret; | |
| 2805 | − | |
| 2806 | − ret = ftrace_arch_code_modify_prepare(); | |
| 2807 | − FTRACE_WARN_ON(ret); | |
| 2808 | − if (ret) | |
| 2809 | − return; | |
| 2802 | + ftrace_arch_code_modify_prepare(); | |
| 2810 | 2803 | |
| 2811 | 2804 | /* |
| 2812 | 2805 | * By default we use stop_machine() to modify the code. |
| @@ -2816,8 +2809,7 @@ static void ftrace_run_update_code(int command) · 3 unmodified lines | ||
| 2816 | 2809 | */ |
| 2817 | 2810 | arch_ftrace_update_code(command); |
| 2818 | 2811 | |
| 2819 | − ret = ftrace_arch_code_modify_post_process(); | |
| 2820 | − FTRACE_WARN_ON(ret); | |
| 2812 | + ftrace_arch_code_modify_post_process(); | |
| 2821 | 2813 | } |
| 2822 | 2814 | |
| 2823 | 2815 | static void ftrace_run_modify_code(struct ftrace_ops *ops, int command, |