Skip to content

Commit

Permalink
powerpc/ptdump: get out of note_prot_wx() when CONFIG_PPC_DEBUG_WX is…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
Christophe Leroy authored and Michael Ellerman committed Aug 20, 2019
1 parent 8224235 commit f3a2ac0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/mm/ptdump/ptdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit f3a2ac0

Please sign in to comment.