aboutsummaryrefslogtreecommitdiffstats
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
parent1e2b904026e9debf95f500b8980a00c43ac0f31c (diff)
memblock: Remove memblock_find()
Nobody uses it anymore. It's semantics were ... weird Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--include/linux/memblock.h1
-rw-r--r--mm/memblock.c32
2 files changed, 0 insertions, 33 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 7d70fdd43db4..776c7d945dcc 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -60,7 +60,6 @@ extern int memblock_is_memory(u64 addr);
60extern int memblock_is_region_memory(u64 base, u64 size); 60extern int memblock_is_region_memory(u64 base, u64 size);
61extern int __init memblock_is_reserved(u64 addr); 61extern int __init memblock_is_reserved(u64 addr);
62extern int memblock_is_region_reserved(u64 base, u64 size); 62extern int memblock_is_region_reserved(u64 base, u64 size);
63extern int memblock_find(struct memblock_region *res);
64 63
65extern void memblock_dump_all(void); 64extern void memblock_dump_all(void);
66 65
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}