diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2020-02-20 12:51:40 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-03-04 12:44:29 +0100 |
commit | 0dec6e1cca7eee6d5616f982efab2ff3b3ea1f9f (patch) | |
tree | c02da5c0b3b6c0e0d1458f9369235d3ceb5bd097 /arch/powerpc/kernel/irq.c | |
parent | powerpc/irq: Use current_stack_pointer in check_stack_overflow() (diff) | |
download | linux-0dec6e1cca7eee6d5616f982efab2ff3b3ea1f9f.tar.xz linux-0dec6e1cca7eee6d5616f982efab2ff3b3ea1f9f.zip |
powerpc/irq: use IS_ENABLED() in check_stack_overflow()
Instead of #ifdef, use IS_ENABLED(CONFIG_DEBUG_STACKOVERFLOW).
This enable GCC to check for code validity even when the option
is not selected.
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/20200220115141.2707-4-mpe@ellerman.id.au
Diffstat (limited to 'arch/powerpc/kernel/irq.c')
-rw-r--r-- | arch/powerpc/kernel/irq.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index c7d6f5cdffdb..46d5852fb00a 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -599,9 +599,11 @@ u64 arch_irq_stat_cpu(unsigned int cpu) static inline void check_stack_overflow(void) { -#ifdef CONFIG_DEBUG_STACKOVERFLOW long sp; + if (!IS_ENABLED(CONFIG_DEBUG_STACKOVERFLOW)) + return; + sp = current_stack_pointer & (THREAD_SIZE - 1); /* check for stack overflow: is there less than 2KB free? */ @@ -609,7 +611,6 @@ static inline void check_stack_overflow(void) pr_err("do_IRQ: stack overflow: %ld\n", sp); dump_stack(); } -#endif } void __do_irq(struct pt_regs *regs) |