From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCDD3C11D05 for ; Thu, 20 Feb 2020 12:00:45 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 912E120722 for ; Thu, 20 Feb 2020 12:00:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="ApAYQmKY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 912E120722 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48NY7t2DgnzDqNS for ; Thu, 20 Feb 2020 23:00:42 +1100 (AEDT) Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48NXxd6KwLzDqDS for ; Thu, 20 Feb 2020 22:51:49 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=ApAYQmKY; dkim-atps=neutral Received: by ozlabs.org (Postfix) id 48NXxd5cLCz9sR4; Thu, 20 Feb 2020 22:51:49 +1100 (AEDT) Received: by ozlabs.org (Postfix, from userid 1034) id 48NXxd4S7Cz9sSD; Thu, 20 Feb 2020 22:51:49 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1582199509; bh=h70tlCo/gMzI2w/SG41TQK9spTIeG2tVhulJDNjQ6sk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ApAYQmKYQD8Vc6z9t0m3bJG8SOZQD29P+75l4xrbB2VwrTk3gkYWZI4BHtY5IlPwo E45S5nS9+e0MMCURXfDwfa5cD4bqFb9uuhgqXee3lOM0iw8HP49RrHiY9jJKivbRcZ 59VhcvppNNZ4G3E4CjXh+Vvj/ZRMLjMUdITpzgnsEIIBguNctZVaB2Wigu/HXfiGH+ bvSHiwy0DtC1tYOavg4MhsVZcpz6z6lvrT9KipjTykjJtAP8bVlREZdT4fMFCmLNYV wTgTNraGxpzOGNq4ZbdZ7RP+IWxz5xIABEPuBwOgtPHDZewibCsbeQGVXfmmW6njFn ifrVXeQ/X+WCw== From: Michael Ellerman To: linuxppc-dev@ozlabs.org Subject: [PATCH v3 4/5] powerpc/irq: use IS_ENABLED() in check_stack_overflow() Date: Thu, 20 Feb 2020 22:51:40 +1100 Message-Id: <20200220115141.2707-4-mpe@ellerman.id.au> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200220115141.2707-1-mpe@ellerman.id.au> References: <20200220115141.2707-1-mpe@ellerman.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Christophe Leroy 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 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/98855694e9e8993673af08cc2e97e16e0cf50f4a.1579849665.git.christophe.leroy@c-s.fr --- arch/powerpc/kernel/irq.c | 5 +++-- 1 file 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) -- 2.21.1