2023-06-20 08:04:13

by Youling Tang

[permalink] [raw]
Subject: [RFC PATCH v1 18/23] LoongArch: Fix fpu.S objtool warning

When objtool checked the fpu.o file, the following warnings appeared,
$ ./tools/objtool/objtool --orc arch/loongarch/kernel/fpu.o
arch/loongarch/kernel/fpu.o: warning: objtool: _save_fp_context() falls through
to next function fault()

This `fault` is only used in extable, it is not a function itself, and change
SYM_FUNC_START(fault) to the label method(.L_fault).

Signed-off-by: Youling Tang <[email protected]>
---
arch/loongarch/kernel/fpu.S | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/loongarch/kernel/fpu.S b/arch/loongarch/kernel/fpu.S
index ccde94140c89..8331835c0591 100644
--- a/arch/loongarch/kernel/fpu.S
+++ b/arch/loongarch/kernel/fpu.S
@@ -20,9 +20,13 @@
#define LSX_REG_WIDTH 16
#define LASX_REG_WIDTH 32

+.L_fault:
+ li.w a0, -EFAULT # failure
+ jr ra
+
.macro EX insn, reg, src, offs
.ex\@: \insn \reg, \src, \offs
- _asm_extable .ex\@, fault
+ _asm_extable .ex\@, .L_fault
.endm

.macro sc_save_fp base
@@ -243,8 +247,3 @@ SYM_FUNC_START(_restore_fp_context)
li.w a0, 0 # success
jr ra
SYM_FUNC_END(_restore_fp_context)
-
-SYM_FUNC_START(fault)
- li.w a0, -EFAULT # failure
- jr ra
-SYM_FUNC_END(fault)
--
2.39.2