Skip to content

Commit b925b43

Browse files
arndbctmarinas
authored andcommitted
arm64: hide unused is_valid_bugaddr()
When generic BUG() support is disabled, this function has no declaration and no callers but causes a W=1 warning: arch/arm64/kernel/traps.c:950:5: error: no previous prototype for 'is_valid_bugaddr' [-Werror=missing-prototypes] Add an #ifdef that matches the one around the declaration. 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 fbc0cd6 commit b925b43

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm64/kernel/traps.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ void do_serror(struct pt_regs *regs, unsigned long esr)
947947
}
948948

949949
/* GENERIC_BUG traps */
950-
950+
#ifdef CONFIG_GENERIC_BUG
951951
int is_valid_bugaddr(unsigned long addr)
952952
{
953953
/*
@@ -959,6 +959,7 @@ int is_valid_bugaddr(unsigned long addr)
959959
*/
960960
return 1;
961961
}
962+
#endif
962963

963964
static int bug_handler(struct pt_regs *regs, unsigned long esr)
964965
{

0 commit comments

Comments
 (0)