]> Pileus Git - ~andy/linux/commitdiff
mm: use pgdat_end_pfn() to simplify the code in arch
authorXishi Qiu <qiuxishi@huawei.com>
Tue, 12 Nov 2013 23:07:17 +0000 (15:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 13 Nov 2013 03:09:03 +0000 (12:09 +0900)
Use "pgdat_end_pfn()" instead of "pgdat->node_start_pfn +
pgdat->node_spanned_pages".  Simplify the code, no functional change.

Signed-off-by: Xishi 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/ia64/mm/init.c
arch/metag/mm/init.c
arch/powerpc/mm/numa.c
arch/sh/mm/init.c

index b6f7f43424ec492187f558b163b525d2d4583395..88504abf570429886183d32d9b857a90adb5c148 100644 (file)
@@ -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 = PAGE_ALIGN(end_address);
-
-       stop_address = (unsigned long) &vmem_map[
-               pgdat->node_start_pfn + pgdat->node_spanned_pages];
+       stop_address = (unsigned long) &vmem_map[pgdat_end_pfn(pgdat)];
 
        do {
                pgd_t *pgd;
index 249fff66add37fb0c939241f8072163145e632a0..3cd6288f65c22bd8c0aed5968d886363d0a9f6fb 100644 (file)
@@ -148,7 +148,7 @@ static void __init bootmem_init_one_node(unsigned int nid)
        if (!p->node_spanned_pages)
                return;
 
-       end_pfn = p->node_start_pfn + p->node_spanned_pages;
+       end_pfn = pgdat_end_pfn(p);
 #ifdef CONFIG_HIGHMEM
        if (end_pfn > max_low_pfn)
                end_pfn = max_low_pfn;
index 33d67844062cbd6b1923052144aeb7945e528b35..078d3e00a6168fe7d56f212c0822800ee77bc9f8 100644 (file)
@@ -938,8 +938,7 @@ static void __init mark_reserved_regions_for_nid(int nid)
                unsigned long start_pfn = physbase >> PAGE_SHIFT;
                unsigned long end_pfn = PFN_UP(physbase + size);
                struct node_active_region node_ar;
-               unsigned long node_end_pfn = node->node_start_pfn +
-                                            node->node_spanned_pages;
+               unsigned long node_end_pfn = pgdat_end_pfn(node);
 
                /*
                 * Check to make sure that this memblock.reserved area is
index 33890fd267cb056c979def415ff6d49f054c55c4..2d089fe2cba910153e8d9bf1db927fd18ca9a83d 100644 (file)
@@ -231,7 +231,7 @@ static void __init bootmem_init_one_node(unsigned int nid)
        if (!p->node_spanned_pages)
                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);