[PATCH 13/24] x86/traps: Mark sync_regs() and fixup_bad_iret() as static __always_inline

From: Lai Jiangshan
Date: Tue Aug 31 2021 - 13:51:54 EST


From: Lai Jiangshan <laijs@xxxxxxxxxxxxxxxxx>

They have solo caller and are used only in traps.c.

Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxxxxx>
---
arch/x86/entry/traps.c | 5 +++--
arch/x86/include/asm/traps.h | 3 ---
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/x86/entry/traps.c b/arch/x86/entry/traps.c
index ab9866b650e7..40722a2f61ae 100644
--- a/arch/x86/entry/traps.c
+++ b/arch/x86/entry/traps.c
@@ -683,7 +683,8 @@ DEFINE_IDTENTRY_RAW(exc_int3)
* to switch to the normal thread stack if the interrupted code was in
* user mode. The actual stack switch is done in entry_64.S
*/
-asmlinkage __visible noinstr struct pt_regs *sync_regs(struct pt_regs *eregs)
+static __always_inline
+struct pt_regs *sync_regs(struct pt_regs *eregs)
{
struct pt_regs *regs = (struct pt_regs *)this_cpu_read(cpu_current_top_of_stack) - 1;
if (regs != eregs)
@@ -734,7 +735,7 @@ asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *r
}
#endif

-asmlinkage __visible noinstr
+static __always_inline
struct pt_regs *fixup_bad_iret(struct pt_regs *bad_regs)
{
/*
diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
index 7b51a8081ae4..5c41a279c1e0 100644
--- a/arch/x86/include/asm/traps.h
+++ b/arch/x86/include/asm/traps.h
@@ -11,9 +11,6 @@
#include <asm/trap_pf.h>

#ifdef CONFIG_X86_64
-asmlinkage __visible notrace struct pt_regs *sync_regs(struct pt_regs *eregs);
-asmlinkage __visible notrace
-struct pt_regs *fixup_bad_iret(struct pt_regs *bad_regs);
asmlinkage __visible notrace struct pt_regs *do_error_entry(struct pt_regs *eregs);
void __init trap_init(void);
asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *eregs);
--
2.19.1.6.gb485710b