linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: kernel: Fix for_each_memblock conversion
Date: Mon, 16 Nov 2020 20:49:05 +0200	[thread overview]
Message-ID: <20201116184905.GA370813@kernel.org> (raw)
In-Reply-To: <20201116174516.144243-1-tsbogend@alpha.franken.de>

On Mon, Nov 16, 2020 at 06:45:15PM +0100, Thomas Bogendoerfer wrote:
> The loop over all memblocks works with PFN numbers and not physical
> addresses, so we need for_each_mem_pfn_range().
> 
> Fixes: b10d6bca8720 ("arch, drivers: replace for_each_membock() with for_each_mem_range()")
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>

Thanks, Thomas!

> ---
>  arch/mips/kernel/setup.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index 0d4253208bde..ca579deef939 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -262,8 +262,8 @@ static void __init bootmem_init(void)
>  static void __init bootmem_init(void)
>  {
>  	phys_addr_t ramstart, ramend;
> -	phys_addr_t start, end;
> -	u64 i;
> +	unsigned long start, end;
> +	int i;
>  
>  	ramstart = memblock_start_of_DRAM();
>  	ramend = memblock_end_of_DRAM();
> @@ -300,7 +300,7 @@ static void __init bootmem_init(void)
>  
>  	min_low_pfn = ARCH_PFN_OFFSET;
>  	max_pfn = PFN_DOWN(ramend);
> -	for_each_mem_range(i, &start, &end) {
> +	for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, NULL) {
>  		/*
>  		 * Skip highmem here so we get an accurate max_low_pfn if low
>  		 * memory stops short of high memory.
> -- 
> 2.16.4
> 

-- 
Sincerely yours,
Mike.

  reply	other threads:[~2020-11-16 18:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 17:45 [PATCH] MIPS: kernel: Fix for_each_memblock conversion Thomas Bogendoerfer
2020-11-16 18:49 ` Mike Rapoport [this message]
2020-11-16 20:05 ` Serge Semin
2020-11-17  8:05   ` Mike Rapoport
2020-11-17  9:12     ` Serge Semin
2020-11-17  9:13     ` Thomas Bogendoerfer
2020-11-17 11:47 ` Thomas Bogendoerfer

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=20201116184905.GA370813@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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;
as well as URLs for NNTP newsgroup(s).