diff options
author | Johannes Weiner <hannes@saeurebad.de> | 2008-07-24 00:27:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:16 -0400 |
commit | 9109fb7b3520de187ebc3646c209d66a233f7169 (patch) | |
tree | f1d64d2efafb8e1652836126523f1b36fb10acd1 /mm | |
parent | 2185e69f680ae8c8496b6fc15e20c889d5b39b67 (diff) |
mm: drop unneeded pgdat argument from free_area_init_node()
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>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory_hotplug.c | 2 | ||||
-rw-r--r-- | mm/page_alloc.c | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 833f854eabe5..6e26adc08f14 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -455,7 +455,7 @@ static pg_data_t *hotadd_new_pgdat(int nid, u64 start) | |||
455 | /* we can use NODE_DATA(nid) from here */ | 455 | /* we can use NODE_DATA(nid) from here */ |
456 | 456 | ||
457 | /* init node's zones as empty zones, we don't have any present pages.*/ | 457 | /* init node's zones as empty zones, we don't have any present pages.*/ |
458 | free_area_init_node(nid, pgdat, zones_size, start_pfn, zholes_size); | 458 | free_area_init_node(nid, zones_size, start_pfn, zholes_size); |
459 | 459 | ||
460 | return pgdat; | 460 | return pgdat; |
461 | } | 461 | } |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 24aa3d1b9d96..e43aae135b38 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -3461,10 +3461,11 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) | |||
3461 | #endif /* CONFIG_FLAT_NODE_MEM_MAP */ | 3461 | #endif /* CONFIG_FLAT_NODE_MEM_MAP */ |
3462 | } | 3462 | } |
3463 | 3463 | ||
3464 | void __paginginit free_area_init_node(int nid, struct pglist_data *pgdat, | 3464 | void __paginginit free_area_init_node(int nid, unsigned long *zones_size, |
3465 | unsigned long *zones_size, unsigned long node_start_pfn, | 3465 | unsigned long node_start_pfn, unsigned long *zholes_size) |
3466 | unsigned long *zholes_size) | ||
3467 | { | 3466 | { |
3467 | pg_data_t *pgdat = NODE_DATA(nid); | ||
3468 | |||
3468 | pgdat->node_id = nid; | 3469 | pgdat->node_id = nid; |
3469 | pgdat->node_start_pfn = node_start_pfn; | 3470 | pgdat->node_start_pfn = node_start_pfn; |
3470 | calculate_node_totalpages(pgdat, zones_size, zholes_size); | 3471 | calculate_node_totalpages(pgdat, zones_size, zholes_size); |
@@ -3961,7 +3962,7 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn) | |||
3961 | setup_nr_node_ids(); | 3962 | setup_nr_node_ids(); |
3962 | for_each_online_node(nid) { | 3963 | for_each_online_node(nid) { |
3963 | pg_data_t *pgdat = NODE_DATA(nid); | 3964 | pg_data_t *pgdat = NODE_DATA(nid); |
3964 | free_area_init_node(nid, pgdat, NULL, | 3965 | free_area_init_node(nid, NULL, |
3965 | find_min_pfn_for_node(nid), NULL); | 3966 | find_min_pfn_for_node(nid), NULL); |
3966 | 3967 | ||
3967 | /* Any memory on that node */ | 3968 | /* Any memory on that node */ |
@@ -4032,7 +4033,7 @@ EXPORT_SYMBOL(contig_page_data); | |||
4032 | 4033 | ||
4033 | void __init free_area_init(unsigned long *zones_size) | 4034 | void __init free_area_init(unsigned long *zones_size) |
4034 | { | 4035 | { |
4035 | free_area_init_node(0, NODE_DATA(0), zones_size, | 4036 | free_area_init_node(0, zones_size, |
4036 | __pa(PAGE_OFFSET) >> PAGE_SHIFT, NULL); | 4037 | __pa(PAGE_OFFSET) >> PAGE_SHIFT, NULL); |
4037 | } | 4038 | } |
4038 | 4039 | ||