mm: drop unneeded pgdat argument from free_area_init_node()
authorJohannes Weiner <hannes@saeurebad.de>
Thu, 24 Jul 2008 04:27:20 +0000 (21:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Jul 2008 17:47:16 +0000 (10:47 -0700)
free_area_init_node() gets passed in the node id as well as the node
descriptor.  This is redundant as the function can trivially get the node
descriptor itself by means of NODE_DATA() and the node's id.

I checked all the users and NODE_DATA() seems to be usable everywhere
from where this function is called.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 files changed:
arch/alpha/mm/numa.c
arch/arm/mm/init.c
arch/avr32/mm/init.c
arch/cris/arch-v10/mm/init.c
arch/cris/arch-v32/mm/init.c
arch/m32r/mm/discontig.c
arch/m32r/mm/init.c
arch/m68k/mm/motorola.c
arch/m68k/mm/sun3mmu.c
arch/parisc/mm/init.c
arch/sparc/mm/srmmu.c
arch/sparc/mm/sun4c.c
arch/v850/kernel/setup.c
include/linux/mm.h
mm/memory_hotplug.c
mm/page_alloc.c

index a53fda0..def0c74 100644 (file)
@@ -313,7 +313,7 @@ void __init paging_init(void)
                        zones_size[ZONE_DMA] = dma_local_pfn;
                        zones_size[ZONE_NORMAL] = (end_pfn - start_pfn) - dma_local_pfn;
                }
-               free_area_init_node(nid, NODE_DATA(nid), zones_size, start_pfn, NULL);
+               free_area_init_node(nid, zones_size, start_pfn, NULL);
        }
 
        /* Initialize the kernel's ZERO_PGE. */
index b657f17..e635294 100644 (file)
@@ -284,7 +284,7 @@ bootmem_init_node(int node, int initrd_node, struct meminfo *mi)
         */
        arch_adjust_zones(node, zone_size, zhole_size);
 
-       free_area_init_node(node, pgdat, zone_size, start_pfn, zhole_size);
+       free_area_init_node(node, zone_size, start_pfn, zhole_size);
 
        return end_pfn;
 }
index 3f90a87..786de88 100644 (file)
@@ -129,7 +129,7 @@ void __init paging_init(void)
                printk("Node %u: start_pfn = 0x%lx, low = 0x%lx\n",
                       nid, start_pfn, low);
 
-               free_area_init_node(nid, pgdat, zones_size, start_pfn, NULL);
+               free_area_init_node(nid, zones_size, start_pfn, NULL);
 
                printk("Node %u: mem_map starts at %p\n",
                       pgdat->node_id, pgdat->node_mem_map);
index e0fcd1a..742fd19 100644 (file)
@@ -182,7 +182,7 @@ paging_init(void)
         * mem_map page array.
         */
 
-       free_area_init_node(0, &contig_page_data, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0);
+       free_area_init_node(0, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0);
 }
 
 /* Initialize remaps of some I/O-ports. It is important that this
index 5a9ac58..8a34b8b 100644 (file)
@@ -162,7 +162,7 @@ paging_init(void)
         * substantially higher than 0, like us (we start at PAGE_OFFSET). This
         * saves space in the mem_map page array.
         */
-       free_area_init_node(0, &contig_page_data, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0);
+       free_area_init_node(0, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0);
 
        mem_map = contig_page_data.node_mem_map;
 }
index aa9145e..cc23934 100644 (file)
@@ -147,8 +147,7 @@ unsigned long __init zone_sizes_init(void)
                zholes_size[ZONE_DMA] = mp->holes;
                holes += zholes_size[ZONE_DMA];
 
-               free_area_init_node(nid, NODE_DATA(nid), zones_size,
-                       start_pfn, zholes_size);
+               free_area_init_node(nid, zones_size, start_pfn, zholes_size);
        }
 
        /*
index bbd97c8..28799af 100644 (file)
@@ -123,7 +123,7 @@ unsigned long __init zone_sizes_init(void)
        start_pfn = __MEMORY_START >> PAGE_SHIFT;
 #endif /* CONFIG_MMU */
 
-       free_area_init_node(0, NODE_DATA(0), zones_size, start_pfn, 0);
+       free_area_init_node(0, zones_size, start_pfn, 0);
 
        return 0;
 }
index 226795b..c5dbb9b 100644 (file)
@@ -296,7 +296,7 @@ void __init paging_init(void)
 #endif
        for (i = 0; i < m68k_num_memory; i++) {
                zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
-               free_area_init_node(i, pg_data_map + i, zones_size,
+               free_area_init_node(i, zones_size,
                                    m68k_memory[i].addr >> PAGE_SHIFT, NULL);
        }
 }
index edceefc..1b902db 100644 (file)
@@ -94,7 +94,7 @@ void __init paging_init(void)
 
        /* I really wish I knew why the following change made things better...  -- Sam */
 /*     free_area_init(zones_size); */
-       free_area_init_node(0, NODE_DATA(0), zones_size,
+       free_area_init_node(0, zones_size,
                            (__pa(PAGE_OFFSET) >> PAGE_SHIFT) + 1, NULL);
 
 
index 0ddf490..7c155c2 100644 (file)
@@ -887,7 +887,7 @@ void __init paging_init(void)
                }
 #endif
 
-               free_area_init_node(i, NODE_DATA(i), zones_size,
+               free_area_init_node(i, zones_size,
                                pmem_ranges[i].start_pfn, NULL);
        }
 }
index c624e04..ee30462 100644 (file)
@@ -1352,8 +1352,7 @@ void __init srmmu_paging_init(void)
                zones_size[ZONE_HIGHMEM] = npages;
                zholes_size[ZONE_HIGHMEM] = npages - calc_highpages();
 
-               free_area_init_node(0, &contig_page_data, zones_size,
-                                   pfn_base, zholes_size);
+               free_area_init_node(0, zones_size, pfn_base, zholes_size);
        }
 }
 
index 2375fe9..d1782f6 100644 (file)
@@ -2123,8 +2123,7 @@ void __init sun4c_paging_init(void)
                zones_size[ZONE_HIGHMEM] = npages;
                zholes_size[ZONE_HIGHMEM] = npages - calc_highpages();
 
-               free_area_init_node(0, &contig_page_data, zones_size,
-                                   pfn_base, zholes_size);
+               free_area_init_node(0, zones_size, pfn_base, zholes_size);
        }
 
        cnt = 0;
index a0a8456..10335ce 100644 (file)
@@ -295,8 +295,7 @@ init_mem_alloc (unsigned long ram_start, unsigned long ram_len)
 #error MAX_ORDER is too large for given PAGE_OFFSET (use CONFIG_FORCE_MAX_ZONEORDER to change it)
 #endif
        NODE_DATA(0)->node_mem_map = NULL;
-       free_area_init_node (0, NODE_DATA(0), zones_size,
-                            ADDR_TO_PAGE (PAGE_OFFSET), 0);
+       free_area_init_node(0, zones_size, ADDR_TO_PAGE (PAGE_OFFSET), 0);
 }
 
 \f
index f807109..196924b 100644 (file)
@@ -962,9 +962,8 @@ static inline void pgtable_page_dtor(struct page *page)
                NULL: pte_offset_kernel(pmd, address))
 
 extern void free_area_init(unsigned long * zones_size);
-extern void free_area_init_node(int nid, pg_data_t *pgdat,
-       unsigned long * zones_size, unsigned long zone_start_pfn, 
-       unsigned long *zholes_size);
+extern void free_area_init_node(int nid, unsigned long * zones_size,
+               unsigned long zone_start_pfn, unsigned long *zholes_size);
 #ifdef CONFIG_ARCH_POPULATES_NODE_MAP
 /*
  * With CONFIG_ARCH_POPULATES_NODE_MAP set, an architecture may initialise its
index 833f854..6e26adc 100644 (file)
@@ -455,7 +455,7 @@ static pg_data_t *hotadd_new_pgdat(int nid, u64 start)
        /* we can use NODE_DATA(nid) from here */
 
        /* init node's zones as empty zones, we don't have any present pages.*/
-       free_area_init_node(nid, pgdat, zones_size, start_pfn, zholes_size);
+       free_area_init_node(nid, zones_size, start_pfn, zholes_size);
 
        return pgdat;
 }
index 24aa3d1..e43aae1 100644 (file)
@@ -3461,10 +3461,11 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
 #endif /* CONFIG_FLAT_NODE_MEM_MAP */
 }
 
-void __paginginit free_area_init_node(int nid, struct pglist_data *pgdat,
-               unsigned long *zones_size, unsigned long node_start_pfn,
-               unsigned long *zholes_size)
+void __paginginit free_area_init_node(int nid, unsigned long *zones_size,
+               unsigned long node_start_pfn, unsigned long *zholes_size)
 {
+       pg_data_t *pgdat = NODE_DATA(nid);
+
        pgdat->node_id = nid;
        pgdat->node_start_pfn = node_start_pfn;
        calculate_node_totalpages(pgdat, zones_size, zholes_size);
@@ -3961,7 +3962,7 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn)
        setup_nr_node_ids();
        for_each_online_node(nid) {
                pg_data_t *pgdat = NODE_DATA(nid);
-               free_area_init_node(nid, pgdat, NULL,
+               free_area_init_node(nid, NULL,
                                find_min_pfn_for_node(nid), NULL);
 
                /* Any memory on that node */
@@ -4032,7 +4033,7 @@ EXPORT_SYMBOL(contig_page_data);
 
 void __init free_area_init(unsigned long *zones_size)
 {
-       free_area_init_node(0, NODE_DATA(0), zones_size,
+       free_area_init_node(0, zones_size,
                        __pa(PAGE_OFFSET) >> PAGE_SHIFT, NULL);
 }