]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
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 a53fda0481ca32c0a33d9f9914f32e3ac94edd98..def0c74a78a8a9502879dc846a25287f3ce0ffe3 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 b657f1719af0e0f50a2498566d981acb616e967f..e6352946dde020e04c3461b2f074972592b74710 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 3f90a87527bb27fe6ce997c0881a1ecfcbbdcc87..786de88a82a7f6af9c94b286772a5f916c08dc93 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 e0fcd1a9bfd5f766ecbd952b1170c6e6c2da1e75..742fd1974c2e590a1121b98cf770e913504676ff 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 5a9ac5834647b222094a19ee83dd74ce1260807f..8a34b8b74293716b953149536a7fbe129a01df73 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 aa9145ef6cca21bf8bdf4ff0906098a0b0a174d6..cc23934bc41e8ea0258e109b743e2e924b85c1b0 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 bbd97c85bc5d8c1222477bb8b9a0786b26d14268..28799af15e9592226e753fa95fa2d64ce43d790b 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 226795bdf3550d5aeee4cc30b4d1f2d6af269ba2..c5dbb9bdb32283c7978736a3b695907e1c076615 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 edceefc18870732c1bf906ec0475c56b4c252050..1b902dbd4376d7bb4a5e6882edba77bb5384515f 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 0ddf4904640a8674a1d5c5cec50d4e681d643bac..7c155c254e72f82cf0dee7d54012de286441fa0b 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 c624e04ff03e4e03ad8c851a51dde6de88444c9d..ee30462598fc72b763da88077b72438be730cbf4 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 2375fe9dc3124346673dfb462d2a137b05374a92..d1782f6368beeadf9afbc9936b3b8e39da75db90 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 a0a8456a8430d6349deee2883ad5646ae65a0f70..10335cecf7bd74fb62698f7dce2d7b50b9bb138c 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 f8071097302ab597274d5e7d8cabc26eaa76492c..196924b657bcc763ccdbf3f8a5e680773402cfa2 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 833f854eabe50ad226696667db7e49d332840bb6..6e26adc08f1405c58bf480656451c17305f6c886 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 24aa3d1b9d9698770831be0c512164a1cd64fd62..e43aae135b38e3972bd3c06691a9ce8777c56f47 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);
 }