From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Dev Jain <dev.jain@arm.com>, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: sparse: Consistently use _nr
Date: Tue, 4 Jun 2024 07:39:38 +0530 [thread overview]
Message-ID: <52773c75-916a-42df-b60f-531770a3cc82@arm.com> (raw)
In-Reply-To: <20240531124144.240399-1-dev.jain@arm.com>
On 5/31/24 18:11, Dev Jain wrote:
> Consistenly name the return variable with an _nr suffix, whenever calling
> pfn_to_section_nr(), to avoid confusion with a (struct mem_section *).
>
> Signed-off-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> mm/sparse.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/mm/sparse.c b/mm/sparse.c
> index de40b2c73406..731f781e91b6 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -192,13 +192,13 @@ static void subsection_mask_set(unsigned long *map, unsigned long pfn,
>
> void __init subsection_map_init(unsigned long pfn, unsigned long nr_pages)
> {
> - int end_sec = pfn_to_section_nr(pfn + nr_pages - 1);
> - unsigned long nr, start_sec = pfn_to_section_nr(pfn);
> + int end_sec_nr = pfn_to_section_nr(pfn + nr_pages - 1);
> + unsigned long nr, start_sec_nr = pfn_to_section_nr(pfn);
>
> if (!nr_pages)
> return;
>
> - for (nr = start_sec; nr <= end_sec; nr++) {
> + for (nr = start_sec_nr; nr <= end_sec_nr; nr++) {
> struct mem_section *ms;
> unsigned long pfns;
>
> @@ -229,17 +229,17 @@ static void __init memory_present(int nid, unsigned long start, unsigned long en
> start &= PAGE_SECTION_MASK;
> mminit_validate_memmodel_limits(&start, &end);
> for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) {
> - unsigned long section = pfn_to_section_nr(pfn);
> + unsigned long section_nr = pfn_to_section_nr(pfn);
> struct mem_section *ms;
>
> - sparse_index_init(section, nid);
> - set_section_nid(section, nid);
> + sparse_index_init(section_nr, nid);
> + set_section_nid(section_nr, nid);
>
> - ms = __nr_to_section(section);
> + ms = __nr_to_section(section_nr);
> if (!ms->section_mem_map) {
> ms->section_mem_map = sparse_encode_early_nid(nid) |
> SECTION_IS_ONLINE;
> - __section_mark_present(ms, section);
> + __section_mark_present(ms, section_nr);
> }
> }
> }
prev parent reply other threads:[~2024-06-04 2:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-31 12:41 [PATCH] mm: sparse: Consistently use _nr Dev Jain
2024-06-03 3:44 ` Oscar Salvador
2024-06-04 2:09 ` Anshuman Khandual [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=52773c75-916a-42df-b60f-531770a3cc82@arm.com \
--to=anshuman.khandual@arm.com \
--cc=akpm@linux-foundation.org \
--cc=dev.jain@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.