From: Mike Rapoport <rppt@kernel.org>
To: Yuntao Wang <ytcoode@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] memblock: Return NUMA_NO_NODE instead of -1 to improve code readability
Date: Fri, 8 Dec 2023 11:35:16 +0200 [thread overview]
Message-ID: <20231208093515.GN636165@kernel.org> (raw)
In-Reply-To: <20231207131001.224914-1-ytcoode@gmail.com>
On Thu, Dec 07, 2023 at 09:10:01PM +0800, Yuntao Wang wrote:
> When no corresponding memory region is found for the given pfn, return
> NUMA_NO_NODE instead of -1. This improves code readability and aligns with
> the existing logic of the memblock_search_pfn_nid() function's user.
>
> Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Applied, thanks!
> ---
> mm/memblock.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 5a88d6d24d79..c1f579c23396 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -1851,7 +1851,7 @@ int __init_memblock memblock_search_pfn_nid(unsigned long pfn,
> int mid = memblock_search(type, PFN_PHYS(pfn));
>
> if (mid == -1)
> - return -1;
> + return NUMA_NO_NODE;
>
> *start_pfn = PFN_DOWN(type->regions[mid].base);
> *end_pfn = PFN_DOWN(type->regions[mid].base + type->regions[mid].size);
> --
> 2.43.0
>
--
Sincerely yours,
Mike.
prev parent reply other threads:[~2023-12-08 9:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 13:10 Yuntao Wang
2023-12-08 9:35 ` Mike Rapoport [this message]
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=20231208093515.GN636165@kernel.org \
--to=rppt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ytcoode@gmail.com \
/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