Re: [PATCH] mm: avoid shadowing global mem_map in sparse_init_one_section()
From: David Hildenbrand (Arm)
Date: Mon Jul 06 2026 - 07:26:04 EST
On 7/5/26 11:17, Mike Rapoport wrote:
> On Sat, Jul 04, 2026 at 11:54:51PM +0530, Anuradha Weeraman wrote:
>> 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.
>
> I suspect that the comment in mmzone.h saying that mem_map is must be
> declared for SPARSEMEM is stale and it can be guarded by #ifdef
> CONFIG_FLATMEM which will be a more correct fix.
>
Unrelated to that, I thought we don't particularly care about W=2 stuff unless
it uncovers a real bug?
--
Cheers,
David