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)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 1 Dec 2023 10:15:33 +0000 (21:15 +1100)
commitf8d3555355653848082c351fa90775214fb8a4fa
treed00d3b45c3ee2079d7afe6a1dc85d5b7ec580951
parentd8c3f243d4db24675b653f0568bb65dae34e6455
powerpc: Fix build error due to is_valid_bugaddr()

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
arch/powerpc/kernel/traps.c