Skip to content

Commit 9ffc9da

Browse files
geertuglaubitz
authored andcommitted
sh: ftrace: Fix missing prototypes
arch/sh/kernel/ftrace.c:130:6: warning: no previous prototype for ‘arch_ftrace_nmi_enter’ [-Wmissing-prototypes] arch/sh/kernel/ftrace.c:140:6: warning: no previous prototype for ‘arch_ftrace_nmi_exit’ [-Wmissing-prototypes] arch/sh/kernel/ftrace.c:316:6: warning: no previous prototype for ‘prepare_ftrace_return’ [-Wmissing-prototypes] Fix this by moving existing forward declarations to <asm/ftrace.h>, and adding the missing forward declaration for prepare_ftrace_return(). Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: John Paul Adrian Glaubitz <[email protected]> Link: https://lore.kernel.org/r/910c8846a025e1c3b744a83ddf8e2816a3c5569d.1709326528.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
1 parent f649f1b commit 9ffc9da

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

arch/sh/include/asm/ftrace.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
3333
return addr;
3434
}
3535

36+
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr);
37+
3638
#endif /* __ASSEMBLY__ */
3739
#endif /* CONFIG_FUNCTION_TRACER */
3840

@@ -43,6 +45,14 @@ extern void *return_address(unsigned int);
4345

4446
#define ftrace_return_address(n) return_address(n)
4547

48+
#ifdef CONFIG_DYNAMIC_FTRACE
49+
extern void arch_ftrace_nmi_enter(void);
50+
extern void arch_ftrace_nmi_exit(void);
51+
#else
52+
static inline void arch_ftrace_nmi_enter(void) { }
53+
static inline void arch_ftrace_nmi_exit(void) { }
54+
#endif
55+
4656
#endif /* __ASSEMBLY__ */
4757

4858
#endif /* __ASM_SH_FTRACE_H */

arch/sh/kernel/traps.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#include <linux/extable.h>
1717
#include <linux/module.h> /* print_modules */
18+
19+
#include <asm/ftrace.h>
1820
#include <asm/unwinder.h>
1921
#include <asm/traps.h>
2022

@@ -170,14 +172,6 @@ BUILD_TRAP_HANDLER(bug)
170172
force_sig(SIGTRAP);
171173
}
172174

173-
#ifdef CONFIG_DYNAMIC_FTRACE
174-
extern void arch_ftrace_nmi_enter(void);
175-
extern void arch_ftrace_nmi_exit(void);
176-
#else
177-
static inline void arch_ftrace_nmi_enter(void) { }
178-
static inline void arch_ftrace_nmi_exit(void) { }
179-
#endif
180-
181175
BUILD_TRAP_HANDLER(nmi)
182176
{
183177
TRAP_HANDLER_DECL;

0 commit comments

Comments
 (0)