提交 6408068e 编写于 作者: X Xishi Qiu 提交者: Linus Torvalds

mm: use pgdat_end_pfn() to simplify the code in arch

Use "pgdat_end_pfn()" instead of "pgdat->node_start_pfn +
pgdat->node_spanned_pages".  Simplify the code, no functional change.
Signed-off-by: NXishi Qiu <qiuxishi@huawei.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 8bfa3f9a
...@@ -357,9 +357,7 @@ int vmemmap_find_next_valid_pfn(int node, int i) ...@@ -357,9 +357,7 @@ int vmemmap_find_next_valid_pfn(int node, int i)
end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i]; end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
end_address = PAGE_ALIGN(end_address); end_address = PAGE_ALIGN(end_address);
stop_address = (unsigned long) &vmem_map[pgdat_end_pfn(pgdat)];
stop_address = (unsigned long) &vmem_map[
pgdat->node_start_pfn + pgdat->node_spanned_pages];
do { do {
pgd_t *pgd; pgd_t *pgd;
......
...@@ -148,7 +148,7 @@ static void __init bootmem_init_one_node(unsigned int nid) ...@@ -148,7 +148,7 @@ static void __init bootmem_init_one_node(unsigned int nid)
if (!p->node_spanned_pages) if (!p->node_spanned_pages)
return; return;
end_pfn = p->node_start_pfn + p->node_spanned_pages; end_pfn = pgdat_end_pfn(p);
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
if (end_pfn > max_low_pfn) if (end_pfn > max_low_pfn)
end_pfn = max_low_pfn; end_pfn = max_low_pfn;
......
...@@ -938,8 +938,7 @@ static void __init mark_reserved_regions_for_nid(int nid) ...@@ -938,8 +938,7 @@ static void __init mark_reserved_regions_for_nid(int nid)
unsigned long start_pfn = physbase >> PAGE_SHIFT; unsigned long start_pfn = physbase >> PAGE_SHIFT;
unsigned long end_pfn = PFN_UP(physbase + size); unsigned long end_pfn = PFN_UP(physbase + size);
struct node_active_region node_ar; struct node_active_region node_ar;
unsigned long node_end_pfn = node->node_start_pfn + unsigned long node_end_pfn = pgdat_end_pfn(node);
node->node_spanned_pages;
/* /*
* Check to make sure that this memblock.reserved area is * Check to make sure that this memblock.reserved area is
......
...@@ -231,7 +231,7 @@ static void __init bootmem_init_one_node(unsigned int nid) ...@@ -231,7 +231,7 @@ static void __init bootmem_init_one_node(unsigned int nid)
if (!p->node_spanned_pages) if (!p->node_spanned_pages)
return; return;
end_pfn = p->node_start_pfn + p->node_spanned_pages; end_pfn = pgdat_end_pfn(p);
total_pages = bootmem_bootmap_pages(p->node_spanned_pages); total_pages = bootmem_bootmap_pages(p->node_spanned_pages);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册