Skip to content

Commit da50c57

Browse files
rppttorvalds
authored andcommitted
xtensa: simplify detection of memory zone boundaries
free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones. After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures. Using this function instead of free_area_init_node() simplifies the zone detection. Signed-off-by: Mike Rapoport <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Tested-by: Hoan Tran <[email protected]> [arm64] Cc: Baoquan He <[email protected]> Cc: Brian Cain <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Greentime Hu <[email protected]> Cc: Greg Ungerer <[email protected]> Cc: Guan Xuetao <[email protected]> Cc: Guo Ren <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Helge Deller <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Ley Foon Tan <[email protected]> Cc: Mark Salter <[email protected]> Cc: Matt Turner <[email protected]> Cc: Max Filippov <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Michal Simek <[email protected]> Cc: Nick Hu <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Rich Felker <[email protected]> Cc: Russell King <[email protected]> Cc: Stafford Horne <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Tony Luck <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: Yoshinori Sato <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 1b02ec0 commit da50c57

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/xtensa/mm/init.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ void __init bootmem_init(void)
7070
void __init zones_init(void)
7171
{
7272
/* All pages are DMA-able, so we put them all in the DMA zone. */
73-
unsigned long zones_size[MAX_NR_ZONES] = {
74-
[ZONE_NORMAL] = max_low_pfn - ARCH_PFN_OFFSET,
73+
unsigned long max_zone_pfn[MAX_NR_ZONES] = {
74+
[ZONE_NORMAL] = max_low_pfn,
7575
#ifdef CONFIG_HIGHMEM
76-
[ZONE_HIGHMEM] = max_pfn - max_low_pfn,
76+
[ZONE_HIGHMEM] = max_pfn,
7777
#endif
7878
};
79-
free_area_init_node(0, zones_size, ARCH_PFN_OFFSET, NULL);
79+
free_area_init(max_zone_pfn);
8080
}
8181

8282
#ifdef CONFIG_HIGHMEM

0 commit comments

Comments
 (0)