mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] x86/mm: Make highstart_pfn and highend_pfn local to initmem_init()
@ 2026-11-11 13:36 Thorsten Blum
  2026-11-11 13:36 ` [PATCH 2/2] x86/mm: Convert printk(KERN_*) to pr_*() in initmem_init() Thorsten Blum
  2026-11-11 17:31 ` [PATCH 1/2] x86/mm: Make highstart_pfn and highend_pfn local to initmem_init() Mike Rapoport
  0 siblings, 2 replies; 5+ messages in thread
From: Thorsten Blum @ 2026-11-11 13:36 UTC (permalink / raw)
  To: Mike Rapoport (Microsoft),
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Andy Lutomirski, Peter Zijlstra, Juergen Gross
  Cc: Thorsten Blum, linux-kernel

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;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-11 18:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11 13:36 [PATCH 1/2] x86/mm: Make highstart_pfn and highend_pfn local to initmem_init() Thorsten Blum
2026-11-11 13:36 ` [PATCH 2/2] x86/mm: Convert printk(KERN_*) to pr_*() in initmem_init() Thorsten Blum
2026-11-11 17:34   ` Mike Rapoport
2026-11-11 18:06     ` Thorsten Blum
2026-11-11 17:31 ` [PATCH 1/2] x86/mm: Make highstart_pfn and highend_pfn local to initmem_init() Mike Rapoport

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®