mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thorsten Blum <blum@kernel.org>
To: "Mike Rapoport (Microsoft)" <rppt@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>, 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>,
	Juergen Gross <jgross@suse.com>
Cc: Thorsten Blum <blum@kernel.org>, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] x86/mm: Make highstart_pfn and highend_pfn local to initmem_init()
Date: Wed, 11 Nov 2026 14:36:34 +0100	[thread overview]
Message-ID: <20261111133635.75044-3-blum@kernel.org> (raw)

Since commit 35c3151a98a6 ("x86/mm: Consolidate initmem_init()") removed
arch/x86/mm/numa_32.c, highstart_pfn and highend_pfn are only used in
initmem_init().

Declare both variables locally and remove their unused extern
declaration. Use min() to initialize highstart_pfn.

No functional change.

Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 arch/x86/include/asm/highmem.h | 3 ---
 arch/x86/mm/init_32.c          | 8 +++-----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/x86/include/asm/highmem.h b/arch/x86/include/asm/highmem.h
index decfaaf52326..31d6d2a556f6 100644
--- a/arch/x86/include/asm/highmem.h
+++ b/arch/x86/include/asm/highmem.h
@@ -27,9 +27,6 @@
 #include <asm/fixmap.h>
 #include <asm/pgtable_areas.h>
 
-/* declarations for highmem.c */
-extern unsigned long highstart_pfn, highend_pfn;
-
 /*
  * Right now we initialize only a single pte table. It can be extended
  * easily, subsequent pte tables have to be allocated in one physical
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 0908c44d51e6..9b0a3dd02da0 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -55,8 +55,6 @@
 
 #include "mm_internal.h"
 
-unsigned long highstart_pfn, highend_pfn;
-
 bool __read_mostly __vmalloc_start_set = false;
 
 /*
@@ -615,9 +613,9 @@ void __init find_low_pfn_range(void)
 void __init initmem_init(void)
 {
 #ifdef CONFIG_HIGHMEM
-	highstart_pfn = highend_pfn = max_pfn;
-	if (max_pfn > max_low_pfn)
-		highstart_pfn = max_low_pfn;
+	unsigned long highstart_pfn = min(max_pfn, max_low_pfn);
+	unsigned long highend_pfn = max_pfn;
+
 	printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
 		pages_to_mb(highend_pfn - highstart_pfn));
 	high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;

             reply	other threads:[~2026-11-11 13:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 13:36 Thorsten Blum [this message]
2026-11-11 13:36 ` [PATCH 2/2] x86/mm: Convert printk(KERN_*) to pr_*() in initmem_init() Thorsten Blum

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=20261111133635.75044-3-blum@kernel.org \
    --to=blum@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rppt@kernel.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

all inboxes | Powered by JetHome®