aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-07-12 03:58:09 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2011-07-13 19:36:01 -0400
commit1f5026a7e21e409c2b9dd54f6dfb9446511fb7c5 (patch)
treebcf0529d5f05ea8b685d6c0fddcb3197c2fab49c /arch/x86/mm
parent348968eb151e2569ad0ebe19b2f9c3c25b5c816a (diff)
memblock: Kill MEMBLOCK_ERROR
25818f0f28 (memblock: Make MEMBLOCK_ERROR be 0) thankfully made MEMBLOCK_ERROR 0 and there already are codes which expect error return to be 0. There's no point in keeping MEMBLOCK_ERROR around. End its misery. Signed-off-by: Tejun Heo <tj@kernel.org> Link: http://lkml.kernel.org/r/1310457490-3356-6-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 'arch/x86/mm')
-rw-r--r--arch/x86/mm/init.c2
-rw-r--r--arch/x86/mm/memblock.c6
-rw-r--r--arch/x86/mm/numa.c6
-rw-r--r--arch/x86/mm/numa_32.c4
-rw-r--r--arch/x86/mm/numa_emulation.c2
5 files changed, 10 insertions, 10 deletions
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 30326443ab81..13cf05a61605 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -68,7 +68,7 @@ static void __init find_early_table_space(unsigned long end, int use_pse,
68#endif 68#endif
69 69
70 base = memblock_find_in_range(start, good_end, tables, PAGE_SIZE); 70 base = memblock_find_in_range(start, good_end, tables, PAGE_SIZE);
71 if (base == MEMBLOCK_ERROR) 71 if (!base)
72 panic("Cannot find space for the kernel page tables"); 72 panic("Cannot find space for the kernel page tables");
73 73
74 pgt_buf_start = base >> PAGE_SHIFT; 74 pgt_buf_start = base >> PAGE_SHIFT;
diff --git a/arch/x86/mm/memblock.c b/arch/x86/mm/memblock.c
index 992da5ec5a64..e126117d1b03 100644
--- a/arch/x86/mm/memblock.c
+++ b/arch/x86/mm/memblock.c
@@ -66,7 +66,7 @@ u64 __init memblock_x86_find_in_range_size(u64 start, u64 *sizep, u64 align)
66 return addr; 66 return addr;
67 } 67 }
68 68
69 return MEMBLOCK_ERROR; 69 return 0;
70} 70}
71 71
72static __init struct range *find_range_array(int count) 72static __init struct range *find_range_array(int count)
@@ -78,7 +78,7 @@ static __init struct range *find_range_array(int count)
78 end = memblock.current_limit; 78 end = memblock.current_limit;
79 79
80 mem = memblock_find_in_range(0, end, size, sizeof(struct range)); 80 mem = memblock_find_in_range(0, end, size, sizeof(struct range));
81 if (mem == MEMBLOCK_ERROR) 81 if (!mem)
82 panic("can not find more space for range array"); 82 panic("can not find more space for range array");
83 83
84 /* 84 /*
@@ -274,7 +274,7 @@ u64 __init memblock_x86_find_in_range_node(int nid, u64 start, u64 end, u64 size
274{ 274{
275 u64 addr; 275 u64 addr;
276 addr = find_memory_core_early(nid, size, align, start, end); 276 addr = find_memory_core_early(nid, size, align, start, end);
277 if (addr != MEMBLOCK_ERROR) 277 if (addr)
278 return addr; 278 return addr;
279 279
280 /* Fallback, should already have start end within node range */ 280 /* Fallback, should already have start end within node range */
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index fbeaaf416610..fa1015de5cc0 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -226,10 +226,10 @@ static void __init setup_node_data(int nid, u64 start, u64 end)
226 } else { 226 } else {
227 nd_pa = memblock_x86_find_in_range_node(nid, nd_low, nd_high, 227 nd_pa = memblock_x86_find_in_range_node(nid, nd_low, nd_high,
228 nd_size, SMP_CACHE_BYTES); 228 nd_size, SMP_CACHE_BYTES);
229 if (nd_pa == MEMBLOCK_ERROR) 229 if (!nd_pa)
230 nd_pa = memblock_find_in_range(nd_low, nd_high, 230 nd_pa = memblock_find_in_range(nd_low, nd_high,
231 nd_size, SMP_CACHE_BYTES); 231 nd_size, SMP_CACHE_BYTES);
232 if (nd_pa == MEMBLOCK_ERROR) { 232 if (!nd_pa) {
233 pr_err("Cannot find %zu bytes in node %d\n", 233 pr_err("Cannot find %zu bytes in node %d\n",
234 nd_size, nid); 234 nd_size, nid);
235 return; 235 return;
@@ -395,7 +395,7 @@ static int __init numa_alloc_distance(void)
395 395
396 phys = memblock_find_in_range(0, PFN_PHYS(max_pfn_mapped), 396 phys = memblock_find_in_range(0, PFN_PHYS(max_pfn_mapped),
397 size, PAGE_SIZE); 397 size, PAGE_SIZE);
398 if (phys == MEMBLOCK_ERROR) { 398 if (!phys) {
399 pr_warning("NUMA: Warning: can't allocate distance table!\n"); 399 pr_warning("NUMA: Warning: can't allocate distance table!\n");
400 /* don't retry until explicitly reset */ 400 /* don't retry until explicitly reset */
401 numa_distance = (void *)1LU; 401 numa_distance = (void *)1LU;
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index 3adebe7e536a..58878b536ef2 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -199,7 +199,7 @@ void __init init_alloc_remap(int nid, u64 start, u64 end)
199 199
200 /* allocate node memory and the lowmem remap area */ 200 /* allocate node memory and the lowmem remap area */
201 node_pa = memblock_find_in_range(start, end, size, LARGE_PAGE_BYTES); 201 node_pa = memblock_find_in_range(start, end, size, LARGE_PAGE_BYTES);
202 if (node_pa == MEMBLOCK_ERROR) { 202 if (!node_pa) {
203 pr_warning("remap_alloc: failed to allocate %lu bytes for node %d\n", 203 pr_warning("remap_alloc: failed to allocate %lu bytes for node %d\n",
204 size, nid); 204 size, nid);
205 return; 205 return;
@@ -209,7 +209,7 @@ void __init init_alloc_remap(int nid, u64 start, u64 end)
209 remap_pa = memblock_find_in_range(min_low_pfn << PAGE_SHIFT, 209 remap_pa = memblock_find_in_range(min_low_pfn << PAGE_SHIFT,
210 max_low_pfn << PAGE_SHIFT, 210 max_low_pfn << PAGE_SHIFT,
211 size, LARGE_PAGE_BYTES); 211 size, LARGE_PAGE_BYTES);
212 if (remap_pa == MEMBLOCK_ERROR) { 212 if (!remap_pa) {
213 pr_warning("remap_alloc: failed to allocate %lu bytes remap area for node %d\n", 213 pr_warning("remap_alloc: failed to allocate %lu bytes remap area for node %d\n",
214 size, nid); 214 size, nid);
215 memblock_x86_free_range(node_pa, node_pa + size); 215 memblock_x86_free_range(node_pa, node_pa + size);
diff --git a/arch/x86/mm/numa_emulation.c b/arch/x86/mm/numa_emulation.c
index d0ed086b6247..e3d471c20cdc 100644
--- a/arch/x86/mm/numa_emulation.c
+++ b/arch/x86/mm/numa_emulation.c
@@ -351,7 +351,7 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt)
351 351
352 phys = memblock_find_in_range(0, PFN_PHYS(max_pfn_mapped), 352 phys = memblock_find_in_range(0, PFN_PHYS(max_pfn_mapped),
353 phys_size, PAGE_SIZE); 353 phys_size, PAGE_SIZE);
354 if (phys == MEMBLOCK_ERROR) { 354 if (!phys) {
355 pr_warning("NUMA: Warning: can't allocate copy of distance table, disabling emulation\n"); 355 pr_warning("NUMA: Warning: can't allocate copy of distance table, disabling emulation\n");
356 goto no_emu; 356 goto no_emu;
357 } 357 }