Skip to content

Commit

Permalink
sparsemem: Fix compilation on PowerPC
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Stephen Rothwell <[email protected]>
Signed-off-by: Yinghai Lu <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
  • Loading branch information
Yinghai Lu authored and H. Peter Anvin committed Mar 2, 2010
1 parent fb90ef9 commit 81d0d95
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions mm/sparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ void __init sparse_mem_maps_populate_node(struct page **map_map,
}
#endif /* !CONFIG_SPARSEMEM_VMEMMAP */

#ifdef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER
static void __init sparse_early_mem_maps_alloc_node(struct page **map_map,
unsigned long pnum_begin,
unsigned long pnum_end,
Expand All @@ -447,8 +448,7 @@ static void __init sparse_early_mem_maps_alloc_node(struct page **map_map,
sparse_mem_maps_populate_node(map_map, pnum_begin, pnum_end,
map_count, nodeid);
}

#ifndef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER
#else
static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum)
{
struct page *map;
Expand Down Expand Up @@ -478,14 +478,17 @@ void __init sparse_init(void)
{
unsigned long pnum;
struct page *map;
struct page **map_map;
unsigned long *usemap;
unsigned long **usemap_map;
int size, size2;
int size;
int nodeid_begin = 0;
unsigned long pnum_begin = 0;
unsigned long usemap_count;
#ifdef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER
unsigned long map_count;
int size2;
struct page **map_map;
#endif

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

0 comments on commit 81d0d95

Please sign in to comment.