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 <arnd@arndb.de> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20230516160642.523862-10-arnd@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent fbc0cd6 commit b925b43

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)