powerpc/code-patching: Remove #ifdef CONFIG_STRICT_KERNEL_RWX
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Fri, 2 Dec 2022 08:31:39 +0000 (09:31 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 2 Dec 2022 10:59:56 +0000 (21:59 +1100)
commit84ecfe6f38ae4ee779ebd97ee173937fff565bf9
tree57ff1093dd08d8d0c858c96a63afb26872dc537b
parentad050d2390fccb22aa3e6f65e11757ce7a5a7ca5
powerpc/code-patching: Remove #ifdef CONFIG_STRICT_KERNEL_RWX

No need to have one implementation of patch_instruction() for
CONFIG_STRICT_KERNEL_RWX and one for !CONFIG_STRICT_KERNEL_RWX.

In patch_instruction(), call raw_patch_instruction() when
!CONFIG_STRICT_KERNEL_RWX.

In poking_init(), bail out immediately, it will be equivalent
to the weak default implementation.

Everything else is declared static and will be discarded by
GCC when !CONFIG_STRICT_KERNEL_RWX.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/f67d2a109404d03e8fdf1ea15388c8778337a76b.1669969781.git.christophe.leroy@csgroup.eu
arch/powerpc/lib/code-patching.c