Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3724286ybl; Sun, 8 Dec 2019 22:08:16 -0800 (PST) X-Google-Smtp-Source: APXvYqy3RIoZoPaVU5RldBPPzi2WFNWx9LvbBBPUPOeuSrBE/MjgMw7KKQHlyuhvCtbnbZE5yXvO X-Received: by 2002:a9d:6c81:: with SMTP id c1mr19093136otr.39.1575871696159; Sun, 08 Dec 2019 22:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575871696; cv=none; d=google.com; s=arc-20160816; b=hMQPfj57ZHTcXx4NRkN0ZdJboPO9BisneCl8yJKWclYzdeHV76334c8nZ1QNURv/PJ wJM1iRxKxvkrxBF43zE8HdQgPIrgQebIeiNTBrp5yHca57ixX/pjLnzU/chBYACP/vPV u9o2H9Q/xiMpBOuUzsbO/j+lmbF7SiQL2R/fGP8nmUHg6eUQHVOvMynspiiME5ZY/HfY +qqISJkqEyaHjC8Epi4VrCNgw/YDVh3OyNZC7jIrdE8msxylsNu7BS5fItHeLqh+Jz7S EjJ0M+vTYgW7x+MnmY29OKgK++XFnmdg8uFlM9ZE3+HtG6ErxuoFitFeQ0jslwUo/Kcm evrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=tkfm9OhHjqXChDBkWF26R6Jd4Y+Bbif1MoEgo3rfn7c=; b=zHRdwDjgZVrFhQGepwmdkw85JPzWivCY4sizpWVDOQNEan+VUXj4iX/R3hif7X17vR bkU/NYCvMgo49671/gdjaDJNyHmwf8JNolAC5Je/jebX0fXvlFmIjXRQhVZq3eLzPG17 FkMAY6WxTs53v95qHzWovJvRX1dWorej6193ZyBaQyB1bCBgUW5HTa81l+dCJ0RHiJ4v 86v6WxfxYwsZPveSir2v9noV1WSgVn9mqTyNvlRZCHZCMy/SrKbFzztH/I/RliKqwYtz EeQtLl7uKw4WmDydgEqfJnQjtRlnpJ3fiW73urJKIXYUBuuaw8zqVKcP3TEcSAp5EGnm vTYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=eoG+puxR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11si11984895otc.209.2019.12.08.22.08.03; Sun, 08 Dec 2019 22:08:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=eoG+puxR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727078AbfLIGH0 (ORCPT + 99 others); Mon, 9 Dec 2019 01:07:26 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:31633 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfLIGHY (ORCPT ); Mon, 9 Dec 2019 01:07:24 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47WXlp4b4fz9v4lJ; Mon, 9 Dec 2019 07:07:18 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=eoG+puxR; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id jaQvifrYL9WH; Mon, 9 Dec 2019 07:07:18 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 47WXlp32nJz9v4lG; Mon, 9 Dec 2019 07:07:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1575871638; bh=tkfm9OhHjqXChDBkWF26R6Jd4Y+Bbif1MoEgo3rfn7c=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=eoG+puxRhsUTlTdIP+906wOHH2+I9ec9bXX4XOG9M0j6MfqBt7BSofvFHrvXrtXOg ZRblVsWZkHLPbwr9rjPo2/BgbJRkALSqmXKfxumIBUjmRPDschUad0HF68Sl/G8AYa 2EzNSb8XqEn0ewYu38bk+CSdHRp6QlW6ox0fnrJw= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id DC2C18B7AF; Mon, 9 Dec 2019 07:07:22 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id jRxt4zlh6ZyY; Mon, 9 Dec 2019 07:07:22 +0100 (CET) Received: from po16098vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.100]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B9DD18B755; Mon, 9 Dec 2019 07:07:22 +0100 (CET) Received: by po16098vm.idsi0.si.c-s.fr (Postfix, from userid 0) id B715663679; Mon, 9 Dec 2019 06:07:22 +0000 (UTC) Message-Id: <9db524b0490235042ed0bca067e6f4db481cbacd.1575871613.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH 2/2] powerpc/irq: use IS_ENABLED() in check_stack_overflow() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 9 Dec 2019 06:07:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 4d468d835558..0aebd7843c73 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -598,16 +598,17 @@ u64 arch_irq_stat_cpu(unsigned int cpu) static inline void check_stack_overflow(void) { -#ifdef CONFIG_DEBUG_STACKOVERFLOW register unsigned long r1 asm("r1"); long sp = r1 & (THREAD_SIZE - 1); + if (!IS_ENABLED(CONFIG_DEBUG_STACKOVERFLOW)) + return; + /* check for stack overflow: is there less than 2KB free? */ if (unlikely(sp < 2048)) { pr_err("do_IRQ: stack overflow: %ld\n", sp); dump_stack(); } -#endif } #ifdef CONFIG_PPC32 -- 2.13.3