From: Brendan Jackman <jackmanb@google.com>
To: Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@kernel.org>
Cc: linux-kernel@vger.kernel.org, Brendan Jackman <jackmanb@google.com>
Subject: [PATCH v2 1/3] x86/mm: drop unused return from init_memory_mapping()
Date: Sun, 03 May 2026 13:04:54 +0000 [thread overview]
Message-ID: <20260503-x86-init-cleanup-v2-1-bb690bd2477c@google.com> (raw)
In-Reply-To: <20260503-x86-init-cleanup-v2-0-bb690bd2477c@google.com>
None of the callers look at the return value.
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
arch/x86/include/asm/pgtable.h | 3 +--
arch/x86/mm/init.c | 16 +++++++---------
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 2187e9cfcefa1..eb09fa7840b49 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -1170,8 +1170,7 @@ extern int direct_gbpages;
void init_mem_mapping(void);
void early_alloc_pgt_buf(void);
void __init poking_init(void);
-unsigned long init_memory_mapping(unsigned long start,
- unsigned long end, pgprot_t prot);
+void init_memory_mapping(unsigned long start, unsigned long end, pgprot_t prot);
#ifdef CONFIG_X86_64
extern pgd_t trampoline_pgd_entry;
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index fb67217fddcd3..ae3e9e0820153 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -531,11 +531,11 @@ bool pfn_range_is_mapped(unsigned long start_pfn, unsigned long end_pfn)
* This runs before bootmem is initialized and gets pages directly from
* the physical memory. To access them they are temporarily mapped.
*/
-unsigned long __ref init_memory_mapping(unsigned long start,
- unsigned long end, pgprot_t prot)
+void __ref init_memory_mapping(unsigned long start,
+ unsigned long end, pgprot_t prot)
{
struct map_range mr[NR_RANGE_MR];
- unsigned long ret = 0;
+ unsigned long paddr_last = 0;
int nr_range, i;
pr_debug("init_memory_mapping: [mem %#010lx-%#010lx]\n",
@@ -545,13 +545,11 @@ unsigned long __ref init_memory_mapping(unsigned long start,
nr_range = split_mem_range(mr, 0, start, end);
for (i = 0; i < nr_range; i++)
- ret = kernel_physical_mapping_init(mr[i].start, mr[i].end,
- mr[i].page_size_mask,
- prot);
+ paddr_last = kernel_physical_mapping_init(mr[i].start, mr[i].end,
+ mr[i].page_size_mask,
+ prot);
- add_pfn_range_mapped(start >> PAGE_SHIFT, ret >> PAGE_SHIFT);
-
- return ret >> PAGE_SHIFT;
+ add_pfn_range_mapped(start >> PAGE_SHIFT, paddr_last >> PAGE_SHIFT);
}
/*
--
2.51.2
next prev parent reply other threads:[~2026-05-03 13:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-03 13:04 [PATCH v2 0/3] x86/mm: some cleanups for pagetable setup code Brendan Jackman
2026-05-03 13:04 ` Brendan Jackman [this message]
2026-05-03 13:04 ` [PATCH v2 2/3] x86/mm: simplify calculation of max_pfn_mapped Brendan Jackman
2026-05-03 13:04 ` [PATCH v2 3/3] x86/mm: drop unused returns from direct map setup functions Brendan Jackman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260503-x86-init-cleanup-v2-1-bb690bd2477c@google.com \
--to=jackmanb@google.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox