summaryrefslogtreecommitdiff
path: root/arch/powerpc/mm/ptdump
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2019-08-14 12:36:12 +0000
committerMichael Ellerman <mpe@ellerman.id.au>2019-08-20 21:22:09 +1000
commitf3a2ac05894b57e78cd6cc0adba1de642034d940 (patch)
tree98ada0ced13469382d5fd2f1faa8e90e391d414e /arch/powerpc/mm/ptdump
parent82242352728125ecd86cea4631b89a5e6be0d0fd (diff)
powerpc/ptdump: get out of note_prot_wx() when CONFIG_PPC_DEBUG_WX is not selected.
When CONFIG_PPC_DEBUG_WX, note_prot_wx() is useless. Get out of it early and inconditionnally in that case, so that GCC can kick all the code out. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/ff6c8f631bd4ce3a10e0cc241eb569816187bc20.1565786091.git.christophe.leroy@c-s.fr
Diffstat (limited to 'arch/powerpc/mm/ptdump')
-rw-r--r--arch/powerpc/mm/ptdump/ptdump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/mm/ptdump/ptdump.c b/arch/powerpc/mm/ptdump/ptdump.c
index 9a2186c133e6..ab6a572202b4 100644
--- a/arch/powerpc/mm/ptdump/ptdump.c
+++ b/arch/powerpc/mm/ptdump/ptdump.c
@@ -177,7 +177,7 @@ static void dump_addr(struct pg_state *st, unsigned long addr)
static void note_prot_wx(struct pg_state *st, unsigned long addr)
{
- if (!st->check_wx)
+ if (!IS_ENABLED(CONFIG_PPC_DEBUG_WX) || !st->check_wx)
return;
if (!((st->current_flags & pgprot_val(PAGE_KERNEL_X)) == pgprot_val(PAGE_KERNEL_X)))