* [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* [PATCH 2/2] x86/mm: Convert printk(KERN_*) to pr_*() in initmem_init()
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 ` Thorsten Blum
2026-11-11 17:34 ` Mike Rapoport
2026-11-11 17:31 ` [PATCH 1/2] x86/mm: Make highstart_pfn and highend_pfn local to initmem_init() Mike Rapoport
1 sibling, 1 reply; 5+ messages in thread
From: Thorsten Blum @ 2026-11-11 13:36 UTC (permalink / raw)
To: Mike Rapoport (Microsoft),
Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin
Cc: Thorsten Blum, linux-kernel
Convert printk(KERN_*) to pr_notice() and pr_info(), use %lu for the
unsigned long arguments, and add spaces around the shift operators.
No functional change.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
arch/x86/mm/init_32.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 9b0a3dd02da0..a799f4cff63f 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -616,8 +616,7 @@ void __init initmem_init(void)
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));
+ pr_notice("%luMB HIGHMEM available.\n", pages_to_mb(highend_pfn - highstart_pfn));
high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
#else
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
@@ -627,12 +626,10 @@ void __init initmem_init(void)
__vmalloc_start_set = true;
- printk(KERN_NOTICE "%ldMB LOWMEM available.\n",
- pages_to_mb(max_low_pfn));
+ pr_notice("%luMB LOWMEM available.\n", pages_to_mb(max_low_pfn));
- printk(KERN_INFO " mapped low ram: 0 - %08lx\n",
- max_pfn_mapped<<PAGE_SHIFT);
- printk(KERN_INFO " low ram: 0 - %08lx\n", max_low_pfn<<PAGE_SHIFT);
+ pr_info(" mapped low ram: 0 - %08lx\n", max_pfn_mapped << PAGE_SHIFT);
+ pr_info(" low ram: 0 - %08lx\n", max_low_pfn << PAGE_SHIFT);
}
/*
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 2/2] x86/mm: Convert printk(KERN_*) to pr_*() in initmem_init()
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
0 siblings, 1 reply; 5+ messages in thread
From: Mike Rapoport @ 2026-11-11 17:34 UTC (permalink / raw)
To: Thorsten Blum
Cc: Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, linux-kernel
On Wed, Nov 11, 2026 at 02:36:35PM +0100, Thorsten Blum wrote:
> Convert printk(KERN_*) to pr_notice() and pr_info(), use %lu for the
> unsigned long arguments, and add spaces around the shift operators.
Heh, there are about 90 printk(KERN_*) in arch/x86/mm and way more in
arch/x86.
Maybe change them in a scripted sweep?
> No functional change.
>
> Signed-off-by: Thorsten Blum <blum@kernel.org>
> ---
> arch/x86/mm/init_32.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
> index 9b0a3dd02da0..a799f4cff63f 100644
> --- a/arch/x86/mm/init_32.c
> +++ b/arch/x86/mm/init_32.c
> @@ -616,8 +616,7 @@ void __init initmem_init(void)
> 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));
> + pr_notice("%luMB HIGHMEM available.\n", pages_to_mb(highend_pfn - highstart_pfn));
> high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
> #else
> high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
> @@ -627,12 +626,10 @@ void __init initmem_init(void)
>
> __vmalloc_start_set = true;
>
> - printk(KERN_NOTICE "%ldMB LOWMEM available.\n",
> - pages_to_mb(max_low_pfn));
> + pr_notice("%luMB LOWMEM available.\n", pages_to_mb(max_low_pfn));
>
> - printk(KERN_INFO " mapped low ram: 0 - %08lx\n",
> - max_pfn_mapped<<PAGE_SHIFT);
> - printk(KERN_INFO " low ram: 0 - %08lx\n", max_low_pfn<<PAGE_SHIFT);
> + pr_info(" mapped low ram: 0 - %08lx\n", max_pfn_mapped << PAGE_SHIFT);
> + pr_info(" low ram: 0 - %08lx\n", max_low_pfn << PAGE_SHIFT);
> }
>
> /*
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 2/2] x86/mm: Convert printk(KERN_*) to pr_*() in initmem_init()
2026-11-11 17:34 ` Mike Rapoport
@ 2026-11-11 18:06 ` Thorsten Blum
0 siblings, 0 replies; 5+ messages in thread
From: Thorsten Blum @ 2026-11-11 18:06 UTC (permalink / raw)
To: Mike Rapoport
Cc: Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, linux-kernel
On Wed, Nov 11, 2026 at 07:34:19PM +0200, Mike Rapoport wrote:
> On Wed, Nov 11, 2026 at 02:36:35PM +0100, Thorsten Blum wrote:
> > Convert printk(KERN_*) to pr_notice() and pr_info(), use %lu for the
> > unsigned long arguments, and add spaces around the shift operators.
>
> Heh, there are about 90 printk(KERN_*) in arch/x86/mm and way more in
> arch/x86.
>
> Maybe change them in a scripted sweep?
I prefer to convert them when I'm already touching the code rather than
in a broader sweep. The %ld to %lu and the spacing changes modify these
lines anyway, which would trigger multiple checkpatch warnings about the
leftover printk(KERN_*) calls.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] x86/mm: Make highstart_pfn and highend_pfn local to initmem_init()
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:31 ` Mike Rapoport
1 sibling, 0 replies; 5+ messages in thread
From: Mike Rapoport @ 2026-11-11 17:31 UTC (permalink / raw)
To: Thorsten Blum
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Peter Zijlstra, Juergen Gross,
linux-kernel
On Wed, Nov 11, 2026 at 02:36:34PM +0100, Thorsten Blum wrote:
> 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>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
> arch/x86/include/asm/highmem.h | 3 ---
> arch/x86/mm/init_32.c | 8 +++-----
> 2 files changed, 3 insertions(+), 8 deletions(-)
--
Sincerely yours,
Mike.
^ 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®