Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17146804 authored by Michael Ellerman's avatar Michael Ellerman Committed by Greg Kroah-Hartman
Browse files

powerpc: Fix build error due to is_valid_bugaddr()



[ 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: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231130114433.3053544-2-mpe@ellerman.id.au


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent f6781add
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1424,10 +1424,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)