Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Anuradha Weeraman <anuradha@debian.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@kernel.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mm: avoid shadowing global mem_map in sparse_init_one_section()
Date: Sat, 4 Jul 2026 23:54:51 +0530	[thread overview]
Message-ID: <aklP82yPNq5lA2Na@riviera.anuradha.dev> (raw)

With W=2, sparse_init_one_section() warns because its mem_map parameter
shadows the global mem_map declaration in linux/mmzone.h.

Rename it to section_mem_map to make that scope explicit and avoid the
shadowing warning.

No functional change.

Signed-off-by: Anuradha Weeraman <anuradha@debian.org>
---
 mm/internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/internal.h b/mm/internal.h
index 181e79f1d6a2..4943def97167 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -957,7 +957,7 @@ void sparse_init(void);
 int sparse_index_init(unsigned long section_nr, int nid);
 
 static inline void sparse_init_one_section(struct mem_section *ms,
-		unsigned long pnum, struct page *mem_map,
+		unsigned long pnum, struct page *section_mem_map,
 		struct mem_section_usage *usage, unsigned long flags)
 {
 	unsigned long coded_mem_map;
@@ -969,7 +969,7 @@ static inline void sparse_init_one_section(struct mem_section *ms,
 	 * page_to_pfn() on !CONFIG_SPARSEMEM_VMEMMAP can simply subtract it
 	 * from the page pointer to obtain the PFN.
 	 */
-	coded_mem_map = (unsigned long)(mem_map - section_nr_to_pfn(pnum));
+	coded_mem_map = (unsigned long)(section_mem_map - section_nr_to_pfn(pnum));
 	VM_WARN_ON_ONCE(coded_mem_map & ~SECTION_MAP_MASK);
 
 	ms->section_mem_map &= ~SECTION_MAP_MASK;
-- 
2.53.0



             reply	other threads:[~2026-07-04 18:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-04 18:24 Anuradha Weeraman [this message]
2026-07-05  9:17 ` [PATCH] mm: avoid shadowing global mem_map in sparse_init_one_section() Mike Rapoport
2026-07-06  9:07   ` David Hildenbrand (Arm)

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=aklP82yPNq5lA2Na@riviera.anuradha.dev \
    --to=anuradha@debian.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox