Skip to content

Commit 81d0d95

Browse files
Yinghai LuH. Peter Anvin
authored andcommitted
sparsemem: Fix compilation on PowerPC
Stephen reported: build (powerpc ppc64_defconfig) produced these warnings: mm/sparse.c: In function 'sparse_init': mm/sparse.c:488: warning: unused variable 'map_count' mm/sparse.c:484: warning: unused variable 'size2' mm/sparse.c:481: warning: unused variable 'map_map' mm/sparse.c: At top level: mm/sparse.c:442: warning: 'sparse_early_mem_maps_alloc_node' defined but not used Introduced by commit 9bdac91 ("sparsemem: Put mem map for one node together"). Conditionalize the bits appropriately based on the setting of CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Yinghai Lu <yinghai@kernel.org> LKML-Reference: <4B895682.1080706@kernel.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
1 parent fb90ef9 commit 81d0d95

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎mm/sparse.c‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ void __init sparse_mem_maps_populate_node(struct page **map_map,
439439
}
440440
#endif /* !CONFIG_SPARSEMEM_VMEMMAP */
441441

442+
#ifdef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER
442443
static void __init sparse_early_mem_maps_alloc_node(struct page **map_map,
443444
unsigned long pnum_begin,
444445
unsigned long pnum_end,
@@ -447,8 +448,7 @@ static void __init sparse_early_mem_maps_alloc_node(struct page **map_map,
447448
sparse_mem_maps_populate_node(map_map, pnum_begin, pnum_end,
448449
map_count, nodeid);
449450
}
450-
451-
#ifndef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER
451+
#else
452452
static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum)
453453
{
454454
struct page *map;
@@ -478,14 +478,17 @@ void __init sparse_init(void)
478478
{
479479
unsigned long pnum;
480480
struct page *map;
481-
struct page **map_map;
482481
unsigned long *usemap;
483482
unsigned long **usemap_map;
484-
int size, size2;
483+
int size;
485484
int nodeid_begin = 0;
486485
unsigned long pnum_begin = 0;
487486
unsigned long usemap_count;
487+
#ifdef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER
488488
unsigned long map_count;
489+
int size2;
490+
struct page **map_map;
491+
#endif
489492

490493
/*
491494
* map is using big page (aka 2M in x86 64 bit)

0 commit comments

Comments
 (0)