[PATCH linux-next] arm/ftrace: Remove the unneeded result variable

cgel.zte at gmail.com cgel.zte at gmail.com
Fri Aug 26 00:26:03 PDT 2022


From: ye xingchen <ye.xingchen at zte.com.cn>

Return the value ftrace_modify_code() directly instead of storing it in
another redundant variable.

Reported-by: Zeal Robot <zealci at zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen at zte.com.cn>
---
 arch/arm/kernel/ftrace.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c
index a0b6d1e3812f..94924a2ecd94 100644
--- a/arch/arm/kernel/ftrace.c
+++ b/arch/arm/kernel/ftrace.c
@@ -190,7 +190,6 @@ int ftrace_make_nop(struct module *mod,
 	unsigned long ip = rec->ip;
 	unsigned long old;
 	unsigned long new;
-	int ret;
 
 #ifdef CONFIG_ARM_MODULE_PLTS
 	/* mod is only supplied during module loading */
@@ -216,9 +215,8 @@ int ftrace_make_nop(struct module *mod,
 	 * so validation may fail spuriously in such cases. Let's work around
 	 * this by omitting those from validation.
 	 */
-	ret = ftrace_modify_code(ip, old, new, !is_kernel_inittext(ip));
 
-	return ret;
+	return ftrace_modify_code(ip, old, new, !is_kernel_inittext(ip));
 }
 #endif /* CONFIG_DYNAMIC_FTRACE */
 
-- 
2.25.1



More information about the linux-arm-kernel mailing list