History

ftrace: Remove return value of ftrace_arch_modify_*()

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

Li kunyu committed 4 years ago

Commit 3a2bfec1 parent 2decd166 files · +13 −28Browse files

Showing the changes to kernel/trace (1 of 6 files). Show all

Unified · Split

kernel/trace/ftrace.c+4−12
@@ -2704,18 +2704,16 @@ ftrace_nop_initialize(struct module *mod, struct dyn_ftrace *rec) · 2703 unmodified lines
27042704 * archs can override this function if they must do something
27052705 * before the modifying code is performed.
27062706 */
2707−int __weak ftrace_arch_code_modify_prepare(void)
2707+void __weak ftrace_arch_code_modify_prepare(void)
27082708 {
2709− return 0;
27102709 }
27112710
27122711 /*
27132712 * archs can override this function if they must do something
27142713 * after the modifying code is performed.
27152714 */
2716−int __weak ftrace_arch_code_modify_post_process(void)
2715+void __weak ftrace_arch_code_modify_post_process(void)
27172716 {
2718− return 0;
27192717 }
27202718
27212719 void ftrace_modify_all_code(int command)
@@ -2801,12 +2799,7 @@ void __weak arch_ftrace_update_code(int command) · 79 unmodified lines
28012799
28022800 static void ftrace_run_update_code(int command)
28032801 {
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();
28102803
28112804 /*
28122805 * 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
28162809 */
28172810 arch_ftrace_update_code(command);
28182811
2819− ret = ftrace_arch_code_modify_post_process();
2820− FTRACE_WARN_ON(ret);
2812+ ftrace_arch_code_modify_post_process();
28212813 }
28222814
28232815 static void ftrace_run_modify_code(struct ftrace_ops *ops, int command,