From patchwork Wed Jul 14 12:50:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 12376857 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 5224EC11F6A for ; Wed, 14 Jul 2021 12:50:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E9B6D613C3 for ; Wed, 14 Jul 2021 12:50:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9B6D613C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 287B66B0083; Wed, 14 Jul 2021 08:50:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E5076B0092; Wed, 14 Jul 2021 08:50:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F2B486B0095; Wed, 14 Jul 2021 08:50:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0146.hostedemail.com [216.40.44.146]) by kanga.kvack.org (Postfix) with ESMTP id CB8DB6B0085 for ; Wed, 14 Jul 2021 08:50:49 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C0DE68095C62 for ; Wed, 14 Jul 2021 12:50:48 +0000 (UTC) X-FDA: 78361177776.01.EAB2839 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [195.130.132.52]) by imf09.hostedemail.com (Postfix) with ESMTP id 104F13000105 for ; Wed, 14 Jul 2021 12:50:47 +0000 (UTC) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed10:39cc:190a:2775:cfe7]) by xavier.telenet-ops.be with bizsmtp id V0qW2500U1ccfby010qW5T; Wed, 14 Jul 2021 14:50:46 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1m3eLO-0018dV-Ab; Wed, 14 Jul 2021 14:50:30 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1m3eLN-00AaEl-Sn; Wed, 14 Jul 2021 14:50:29 +0200 From: Geert Uytterhoeven To: Rob Herring , Russell King , Nicolas Pitre , Ard Biesheuvel , Linus Walleij , Catalin Marinas , Will Deacon , Nick Kossifidis , Paul Walmsley , Palmer Dabbelt , Albert Ou , Frank Rowand , Dave Young , Mike Rapoport Cc: Baoquan He , Vivek Goyal , Andrew Morton , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kexec@lists.infradead.org, linux-mm@kvack.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v4 09/10] arm64: kdump: Use IS_ENABLED(CONFIG_CRASH_DUMP) instead of #ifdef Date: Wed, 14 Jul 2021 14:50:19 +0200 Message-Id: <767e34a7ec29c417fdd5ff6e0fc76bc93d4f3c6f.1626266516.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: imf09.hostedemail.com; dkim=none; spf=none (imf09.hostedemail.com: domain of geert@linux-m68k.org has no SPF policy when checking 195.130.132.52) smtp.mailfrom=geert@linux-m68k.org; dmarc=none X-Stat-Signature: cnmrhk7kmfx3b7edqr5p8skcn8pe473h X-Rspamd-Queue-Id: 104F13000105 X-Rspamd-Server: rspam01 X-HE-Tag: 1626267047-904044 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Replace the conditional compilation using "#ifdef CONFIG_CRASH_DUMP" by a check for "IS_ENABLED(CONFIG_CRASH_DUMP)", to increase compile coverage and to simplify the code. Signed-off-by: Geert Uytterhoeven --- v4: - New. --- arch/arm64/mm/init.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index f90ba99437c0f3c9..dc2a5b73232843e4 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -124,7 +124,6 @@ static void __init reserve_crashkernel(void) } #endif /* CONFIG_KEXEC_CORE */ -#ifdef CONFIG_CRASH_DUMP /* * reserve_elfcorehdr() - reserves memory for elf core header * @@ -135,7 +134,7 @@ static void __init reserve_crashkernel(void) */ static void __init reserve_elfcorehdr(void) { - if (!elfcorehdr_size) + if (!IS_ENABLED(CONFIG_CRASH_DUMP) || !elfcorehdr_size) return; if (memblock_is_region_reserved(elfcorehdr_addr, elfcorehdr_size)) { @@ -148,11 +147,6 @@ static void __init reserve_elfcorehdr(void) pr_info("Reserving %lldKB of memory at 0x%llx for elfcorehdr\n", elfcorehdr_size >> 10, elfcorehdr_addr); } -#else -static void __init reserve_elfcorehdr(void) -{ -} -#endif /* CONFIG_CRASH_DUMP */ /* * Return the maximum physical address for a zone accessible by the given bits