]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
powerpc: Fix build error due to is_valid_bugaddr()
authorMichael Ellerman <mpe@ellerman.id.au>
Thu, 30 Nov 2023 11:44:33 +0000 (22:44 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 07:42:02 +0000 (08:42 +0100)
[ Upstream commit f8d3555355653848082c351fa90775214fb8a4fa ]

With CONFIG_GENERIC_BUG=n the build fails with:

  arch/powerpc/kernel/traps.c:1442:5: error: no previous prototype for ‘is_valid_bugaddr’ [-Werror=missing-prototypes]
  1442 | int is_valid_bugaddr(unsigned long addr)
       |     ^~~~~~~~~~~~~~~~

The prototype is only defined, and the function is only needed, when
CONFIG_GENERIC_BUG=y, so move the implementation under that.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231130114433.3053544-2-mpe@ellerman.id.au
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kernel/traps.c

index 5e5a2448ae79a6281f2a0662d107dc37c1ed090f..b0e87dce2b9a0cb0d0037da5ddeefc991f10a649 100644 (file)
@@ -1432,10 +1432,12 @@ static int emulate_instruction(struct pt_regs *regs)
        return -EINVAL;
 }
 
+#ifdef CONFIG_GENERIC_BUG
 int is_valid_bugaddr(unsigned long addr)
 {
        return is_kernel_addr(addr);
 }
+#endif
 
 #ifdef CONFIG_MATH_EMULATION
 static int emulate_math(struct pt_regs *regs)