From patchwork Thu Sep 2 21:50:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12472639 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 191E7C433EF for ; Thu, 2 Sep 2021 21:50:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 992A4610A1 for ; Thu, 2 Sep 2021 21:50:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 992A4610A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 3C3ED6B0074; Thu, 2 Sep 2021 17:50:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 34C686B0075; Thu, 2 Sep 2021 17:50:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 214808D0001; Thu, 2 Sep 2021 17:50:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 11A0A6B0074 for ; Thu, 2 Sep 2021 17:50:07 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B9E5120BE4 for ; Thu, 2 Sep 2021 21:50:06 +0000 (UTC) X-FDA: 78543976812.18.D080234 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf22.hostedemail.com (Postfix) with ESMTP id 6163E1900 for ; Thu, 2 Sep 2021 21:50:06 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 45E4560F12; Thu, 2 Sep 2021 21:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1630619405; bh=xf84UPadpzjXj13H7EDbimJWmfWf/BtWxQ7uTXeuzZw=; h=Date:From:To:Subject:In-Reply-To:From; b=155BVV51D+n14CEo31H2yGf0LB7itAmpmOEW5iydd+X4ii7TXT/iZGkROuSxrLOHS VQYD1bZdqB2+9q8N0/wJTxsi0b0yfIcYyqu9Oxe7lC4Y8aHuzVXu6ONBU10GYuKxp5 6WcIJrcG0nZfL9XfDJHWo6uqfkEHt6RYWo3kJHhc= Date: Thu, 02 Sep 2021 14:50:04 -0700 From: Andrew Morton To: akpm@linux-foundation.org, frowand.list@gmail.com, geert+renesas@glider.be, horms@verge.net.au, jlan@sgi.com, linux-mm@kvack.org, magnus.damm@gmail.com, mm-commits@vger.kernel.org, robh+dt@kernel.org, rppt@linux.vnet.ibm.com, tony.luck@intel.com, torvalds@linux-foundation.org Subject: [patch 003/212] ia64: make reserve_elfcorehdr() static Message-ID: <20210902215004.Xtl4qh2JH%akpm@linux-foundation.org> In-Reply-To: <20210902144820.78957dff93d7bea620d55a89@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=155BVV51; spf=pass (imf22.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Stat-Signature: obkz7fa6eixebahnzew3j1bk6gk7g1z7 X-Rspamd-Queue-Id: 6163E1900 X-Rspamd-Server: rspam04 X-HE-Tag: 1630619406-909212 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: From: Geert Uytterhoeven Subject: ia64: make reserve_elfcorehdr() static There never was a reason for reserve_elfcorehdr() to be global. Make the function static, and move it before its sole caller. Link: https://lkml.kernel.org/r/fe236cd73b64abc4abd03dd808cb015c907f4c8c.1629884459.git.geert+renesas@glider.be Fixes: cee87af2a5f75713 ("[IA64] kexec: Use EFI_LOADER_DATA for ELF core header") Signed-off-by: Geert Uytterhoeven Cc: Frank Rowand Cc: Jay Lan Cc: Magnus Damm Cc: Mike Rapoport Cc: Rob Herring Cc: Simon Horman Cc: Tony Luck Signed-off-by: Andrew Morton --- arch/ia64/include/asm/meminit.h | 1 arch/ia64/kernel/setup.c | 51 ++++++++++++++---------------- 2 files changed, 25 insertions(+), 27 deletions(-) --- a/arch/ia64/include/asm/meminit.h~ia64-make-reserve_elfcorehdr-static +++ a/arch/ia64/include/asm/meminit.h @@ -40,7 +40,6 @@ extern unsigned long efi_memmap_init(u64 extern int find_max_min_low_pfn (u64, u64, void *); extern unsigned long vmcore_find_descriptor_size(unsigned long address); -extern int reserve_elfcorehdr(u64 *start, u64 *end); /* * For rounding an address to the next IA64_GRANULE_SIZE or order --- a/arch/ia64/kernel/setup.c~ia64-make-reserve_elfcorehdr-static +++ a/arch/ia64/kernel/setup.c @@ -325,6 +325,31 @@ static inline void __init setup_crashker {} #endif +#ifdef CONFIG_CRASH_DUMP +static int __init reserve_elfcorehdr(u64 *start, u64 *end) +{ + u64 length; + + /* We get the address using the kernel command line, + * but the size is extracted from the EFI tables. + * Both address and size are required for reservation + * to work properly. + */ + + if (!is_vmcore_usable()) + return -EINVAL; + + if ((length = vmcore_find_descriptor_size(elfcorehdr_addr)) == 0) { + vmcore_unusable(); + return -EINVAL; + } + + *start = (unsigned long)__va(elfcorehdr_addr); + *end = *start + length; + return 0; +} +#endif /* CONFIG_CRASH_DUMP */ + /** * reserve_memory - setup reserved memory areas * @@ -522,32 +547,6 @@ static __init int setup_nomca(char *s) } early_param("nomca", setup_nomca); -#ifdef CONFIG_CRASH_DUMP -int __init reserve_elfcorehdr(u64 *start, u64 *end) -{ - u64 length; - - /* We get the address using the kernel command line, - * but the size is extracted from the EFI tables. - * Both address and size are required for reservation - * to work properly. - */ - - if (!is_vmcore_usable()) - return -EINVAL; - - if ((length = vmcore_find_descriptor_size(elfcorehdr_addr)) == 0) { - vmcore_unusable(); - return -EINVAL; - } - - *start = (unsigned long)__va(elfcorehdr_addr); - *end = *start + length; - return 0; -} - -#endif /* CONFIG_CRASH_DUMP */ - void __init setup_arch (char **cmdline_p) {