diff options
author | Grygorii Strashko <grygorii.strashko@ti.com> | 2014-01-21 18:50:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 19:19:46 -0500 |
commit | 87029ee9390b2297dae699d5fb135b77992116e5 (patch) | |
tree | decb6411c2b7631a834ebe666f70d9f6993bf3df | |
parent | 79f40fab0b3a78e0e41fac79a65a9870f4b05652 (diff) |
mm/memblock: reorder parameters of memblock_find_in_range_node
Reorder parameters of memblock_find_in_range_node to be consistent with
other memblock APIs.
The change was suggested by Tejun Heo <tj@kernel.org>.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/memblock.h | 5 | ||||
-rw-r--r-- | mm/memblock.c | 16 | ||||
-rw-r--r-- | mm/nobootmem.c | 2 |
3 files changed, 12 insertions, 11 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 2f52c8c492bd..11c31590cc49 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -55,8 +55,9 @@ extern bool movable_node_enabled; | |||
55 | #define memblock_dbg(fmt, ...) \ | 55 | #define memblock_dbg(fmt, ...) \ |
56 | if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 56 | if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
57 | 57 | ||
58 | phys_addr_t memblock_find_in_range_node(phys_addr_t start, phys_addr_t end, | 58 | phys_addr_t memblock_find_in_range_node(phys_addr_t size, phys_addr_t align, |
59 | phys_addr_t size, phys_addr_t align, int nid); | 59 | phys_addr_t start, phys_addr_t end, |
60 | int nid); | ||
60 | phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, | 61 | phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, |
61 | phys_addr_t size, phys_addr_t align); | 62 | phys_addr_t size, phys_addr_t align); |
62 | phys_addr_t get_allocated_memblock_reserved_regions_info(phys_addr_t *addr); | 63 | phys_addr_t get_allocated_memblock_reserved_regions_info(phys_addr_t *addr); |
diff --git a/mm/memblock.c b/mm/memblock.c index 6aca54812db0..a95d6dc066d5 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
@@ -157,10 +157,10 @@ __memblock_find_range_top_down(phys_addr_t start, phys_addr_t end, | |||
157 | 157 | ||
158 | /** | 158 | /** |
159 | * memblock_find_in_range_node - find free area in given range and node | 159 | * memblock_find_in_range_node - find free area in given range and node |
160 | * @start: start of candidate range | ||
161 | * @end: end of candidate range, can be %MEMBLOCK_ALLOC_{ANYWHERE|ACCESSIBLE} | ||
162 | * @size: size of free area to find | 160 | * @size: size of free area to find |
163 | * @align: alignment of free area to find | 161 | * @align: alignment of free area to find |
162 | * @start: start of candidate range | ||
163 | * @end: end of candidate range, can be %MEMBLOCK_ALLOC_{ANYWHERE|ACCESSIBLE} | ||
164 | * @nid: nid of the free area to find, %MAX_NUMNODES for any node | 164 | * @nid: nid of the free area to find, %MAX_NUMNODES for any node |
165 | * | 165 | * |
166 | * Find @size free area aligned to @align in the specified range and node. | 166 | * Find @size free area aligned to @align in the specified range and node. |
@@ -176,9 +176,9 @@ __memblock_find_range_top_down(phys_addr_t start, phys_addr_t end, | |||
176 | * RETURNS: | 176 | * RETURNS: |
177 | * Found address on success, 0 on failure. | 177 | * Found address on success, 0 on failure. |
178 | */ | 178 | */ |
179 | phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t start, | 179 | phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size, |
180 | phys_addr_t end, phys_addr_t size, | 180 | phys_addr_t align, phys_addr_t start, |
181 | phys_addr_t align, int nid) | 181 | phys_addr_t end, int nid) |
182 | { | 182 | { |
183 | int ret; | 183 | int ret; |
184 | phys_addr_t kernel_end; | 184 | phys_addr_t kernel_end; |
@@ -241,8 +241,8 @@ phys_addr_t __init_memblock memblock_find_in_range(phys_addr_t start, | |||
241 | phys_addr_t end, phys_addr_t size, | 241 | phys_addr_t end, phys_addr_t size, |
242 | phys_addr_t align) | 242 | phys_addr_t align) |
243 | { | 243 | { |
244 | return memblock_find_in_range_node(start, end, size, align, | 244 | return memblock_find_in_range_node(size, align, start, end, |
245 | MAX_NUMNODES); | 245 | MAX_NUMNODES); |
246 | } | 246 | } |
247 | 247 | ||
248 | static void __init_memblock memblock_remove_region(struct memblock_type *type, unsigned long r) | 248 | static void __init_memblock memblock_remove_region(struct memblock_type *type, unsigned long r) |
@@ -975,7 +975,7 @@ static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size, | |||
975 | /* align @size to avoid excessive fragmentation on reserved array */ | 975 | /* align @size to avoid excessive fragmentation on reserved array */ |
976 | size = round_up(size, align); | 976 | size = round_up(size, align); |
977 | 977 | ||
978 | found = memblock_find_in_range_node(0, max_addr, size, align, nid); | 978 | found = memblock_find_in_range_node(size, align, 0, max_addr, nid); |
979 | if (found && !memblock_reserve(found, size)) | 979 | if (found && !memblock_reserve(found, size)) |
980 | return found; | 980 | return found; |
981 | 981 | ||
diff --git a/mm/nobootmem.c b/mm/nobootmem.c index 2c254d374655..59777e050d09 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c | |||
@@ -41,7 +41,7 @@ static void * __init __alloc_memory_core_early(int nid, u64 size, u64 align, | |||
41 | if (limit > memblock.current_limit) | 41 | if (limit > memblock.current_limit) |
42 | limit = memblock.current_limit; | 42 | limit = memblock.current_limit; |
43 | 43 | ||
44 | addr = memblock_find_in_range_node(goal, limit, size, align, nid); | 44 | addr = memblock_find_in_range_node(size, align, goal, limit, nid); |
45 | if (!addr) | 45 | if (!addr) |
46 | return NULL; | 46 | return NULL; |
47 | 47 | ||