Skip to content

Commit ec3a3db

Browse files
arndbctmarinas
authored andcommitted
arm64: move cpu_suspend_set_dbg_restorer() prototype to header
The cpu_suspend_set_dbg_restorer() function is called by the hw_breakpoint code but defined in another file. Since the declaration is in the same file as the caller, the compiler warns about the definition without a prior prototype: arch/arm64/kernel/suspend.c:35:13: error: no previous prototype for 'cpu_suspend_set_dbg_restorer' [-Werror=missing-prototypes] Move it into the corresponding header instead to avoid the warning. Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Kees Cook <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 6ac19f9 commit ec3a3db

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

arch/arm64/include/asm/hw_breakpoint.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,12 @@ static inline int get_num_wrps(void)
154154
ID_AA64DFR0_EL1_WRPs_SHIFT);
155155
}
156156

157+
#ifdef CONFIG_CPU_PM
158+
extern void cpu_suspend_set_dbg_restorer(int (*hw_bp_restore)(unsigned int));
159+
#else
160+
static inline void cpu_suspend_set_dbg_restorer(int (*hw_bp_restore)(unsigned int))
161+
{
162+
}
163+
#endif
164+
157165
#endif /* __ASM_BREAKPOINT_H */

arch/arm64/kernel/hw_breakpoint.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -973,14 +973,6 @@ static int hw_breakpoint_reset(unsigned int cpu)
973973
return 0;
974974
}
975975

976-
#ifdef CONFIG_CPU_PM
977-
extern void cpu_suspend_set_dbg_restorer(int (*hw_bp_restore)(unsigned int));
978-
#else
979-
static inline void cpu_suspend_set_dbg_restorer(int (*hw_bp_restore)(unsigned int))
980-
{
981-
}
982-
#endif
983-
984976
/*
985977
* One-time initialisation.
986978
*/

0 commit comments

Comments
 (0)