Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Christophe Leroy and committed by
Michael Ellerman
0dec6e1c 84ab1489

+3 -2
+3 -2
arch/powerpc/kernel/irq.c
··· 599 599 600 600 static inline void check_stack_overflow(void) 601 601 { 602 - #ifdef CONFIG_DEBUG_STACKOVERFLOW 603 602 long sp; 603 + 604 + if (!IS_ENABLED(CONFIG_DEBUG_STACKOVERFLOW)) 605 + return; 604 606 605 607 sp = current_stack_pointer & (THREAD_SIZE - 1); 606 608 ··· 611 609 pr_err("do_IRQ: stack overflow: %ld\n", sp); 612 610 dump_stack(); 613 611 } 614 - #endif 615 612 } 616 613 617 614 void __do_irq(struct pt_regs *regs)