Re: [PATCH 2/2] x86/mm: Convert printk(KERN_*) to pr_*() in initmem_init()

From: Mike Rapoport

Date: Wed Nov 11 2026 - 12:40:32 EST


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@xxxxxxxxxx>
> ---
> 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.