aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-08-03 23:52:55 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-08-04 22:56:03 -0400
commitb693fffb189fbfe7e1e8317ce5838808be8666a0 (patch)
tree432d1caa8c4a4ba9f0c76c1502af0a232bd8f62b /mm
parent1e2b904026e9debf95f500b8980a00c43ac0f31c (diff)
memblock: Remove memblock_find()
Nobody uses it anymore. It's semantics were ... weird Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memblock.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index aa88c62bce7f..8a118b71cbec 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -531,35 +531,3 @@ int memblock_is_region_reserved(u64 base, u64 size)
531 return memblock_overlaps_region(&memblock.reserved, base, size) >= 0; 531 return memblock_overlaps_region(&memblock.reserved, base, size) >= 0;
532} 532}
533 533
534/*
535 * Given a <base, len>, find which memory regions belong to this range.
536 * Adjust the request and return a contiguous chunk.
537 */
538int memblock_find(struct memblock_region *res)
539{
540 int i;
541 u64 rstart, rend;
542
543 rstart = res->base;
544 rend = rstart + res->size - 1;
545
546 for (i = 0; i < memblock.memory.cnt; i++) {
547 u64 start = memblock.memory.regions[i].base;
548 u64 end = start + memblock.memory.regions[i].size - 1;
549
550 if (start > rend)
551 return -1;
552
553 if ((end >= rstart) && (start < rend)) {
554 /* adjust the request */
555 if (rstart < start)
556 rstart = start;
557 if (rend > end)
558 rend = end;
559 res->base = rstart;
560 res->size = rend - rstart + 1;
561 return 0;
562 }
563 }
564 return -1;
565}