aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memblock.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-07-12 03:58:10 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2011-07-13 19:36:02 -0400
commitfc769a8e70a3348d5de49e5f69f6aff810157360 (patch)
tree1dc850a4092602ed5ed5d238bc293c7202b99f3a /mm/memblock.c
parent1f5026a7e21e409c2b9dd54f6dfb9446511fb7c5 (diff)
memblock: Replace memblock_find_base() with memblock_find_in_range()
memblock_find_base() is a static function with two callers in memblock.c and memblock_find_in_range() is a wrapper around it which just changes the types and order of parameters. Make memblock_find_in_range() take phys_addr_t instead of u64 for consistency and replace memblock_find_base() with it. Signed-off-by: Tejun Heo <tj@kernel.org> Link: http://lkml.kernel.org/r/1310457490-3356-7-git-send-email-tj@kernel.org Cc: Yinghai Lu <yinghai@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'mm/memblock.c')
-rw-r--r--mm/memblock.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index 196993661346..0f9626f01b5e 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -97,8 +97,11 @@ static phys_addr_t __init_memblock memblock_find_region(phys_addr_t start, phys_
97 return 0; 97 return 0;
98} 98}
99 99
100static phys_addr_t __init_memblock memblock_find_base(phys_addr_t size, 100/*
101 phys_addr_t align, phys_addr_t start, phys_addr_t end) 101 * Find a free area with specified alignment in a specific range.
102 */
103phys_addr_t __init_memblock memblock_find_in_range(phys_addr_t start, phys_addr_t end,
104 phys_addr_t size, phys_addr_t align)
102{ 105{
103 long i; 106 long i;
104 107
@@ -133,14 +136,6 @@ static phys_addr_t __init_memblock memblock_find_base(phys_addr_t size,
133} 136}
134 137
135/* 138/*
136 * Find a free area with specified alignment in a specific range.
137 */
138u64 __init_memblock memblock_find_in_range(u64 start, u64 end, u64 size, u64 align)
139{
140 return memblock_find_base(size, align, start, end);
141}
142
143/*
144 * Free memblock.reserved.regions 139 * Free memblock.reserved.regions
145 */ 140 */
146int __init_memblock memblock_free_reserved_regions(void) 141int __init_memblock memblock_free_reserved_regions(void)
@@ -216,7 +211,7 @@ static int __init_memblock memblock_double_array(struct memblock_type *type)
216 new_array = kmalloc(new_size, GFP_KERNEL); 211 new_array = kmalloc(new_size, GFP_KERNEL);
217 addr = new_array ? __pa(new_array) : 0; 212 addr = new_array ? __pa(new_array) : 0;
218 } else 213 } else
219 addr = memblock_find_base(new_size, sizeof(phys_addr_t), 0, MEMBLOCK_ALLOC_ACCESSIBLE); 214 addr = memblock_find_in_range(0, MEMBLOCK_ALLOC_ACCESSIBLE, new_size, sizeof(phys_addr_t));
220 if (!addr) { 215 if (!addr) {
221 pr_err("memblock: Failed to double %s array from %ld to %ld entries !\n", 216 pr_err("memblock: Failed to double %s array from %ld to %ld entries !\n",
222 memblock_type_name(type), type->max, type->max * 2); 217 memblock_type_name(type), type->max, type->max * 2);
@@ -477,7 +472,7 @@ phys_addr_t __init __memblock_alloc_base(phys_addr_t size, phys_addr_t align, ph
477 */ 472 */
478 size = round_up(size, align); 473 size = round_up(size, align);
479 474
480 found = memblock_find_base(size, align, 0, max_addr); 475 found = memblock_find_in_range(0, max_addr, size, align);
481 if (found && !memblock_add_region(&memblock.reserved, found, size)) 476 if (found && !memblock_add_region(&memblock.reserved, found, size))
482 return found; 477 return found;
483 478