Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <geert+renesas@glider.be>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/r/910c8846a025e1c3b744a83ddf8e2816a3c5569d.1709326528.git.geert+renesas@glider.be
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

authored by

Geert Uytterhoeven and committed by
John Paul Adrian Glaubitz
9ffc9da6 f649f1b8

+12 -8
+10
arch/sh/include/asm/ftrace.h
··· 33 33 return addr; 34 34 } 35 35 36 + void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr); 37 + 36 38 #endif /* __ASSEMBLY__ */ 37 39 #endif /* CONFIG_FUNCTION_TRACER */ 38 40 ··· 44 42 extern void *return_address(unsigned int); 45 43 46 44 #define ftrace_return_address(n) return_address(n) 45 + 46 + #ifdef CONFIG_DYNAMIC_FTRACE 47 + extern void arch_ftrace_nmi_enter(void); 48 + extern void arch_ftrace_nmi_exit(void); 49 + #else 50 + static inline void arch_ftrace_nmi_enter(void) { } 51 + static inline void arch_ftrace_nmi_exit(void) { } 52 + #endif 47 53 48 54 #endif /* __ASSEMBLY__ */ 49 55
+2 -8
arch/sh/kernel/traps.c
··· 15 15 16 16 #include <linux/extable.h> 17 17 #include <linux/module.h> /* print_modules */ 18 + 19 + #include <asm/ftrace.h> 18 20 #include <asm/unwinder.h> 19 21 #include <asm/traps.h> 20 22 ··· 171 169 172 170 force_sig(SIGTRAP); 173 171 } 174 - 175 - #ifdef CONFIG_DYNAMIC_FTRACE 176 - extern void arch_ftrace_nmi_enter(void); 177 - extern void arch_ftrace_nmi_exit(void); 178 - #else 179 - static inline void arch_ftrace_nmi_enter(void) { } 180 - static inline void arch_ftrace_nmi_exit(void) { } 181 - #endif 182 172 183 173 BUILD_TRAP_HANDLER(nmi) 184 174 {