memblock: Fix memblock_is_region_reserved() to return a boolean
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 4 Aug 2010 04:17:17 +0000 (14:17 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 4 Aug 2010 04:17:17 +0000 (14:17 +1000)
All callers expect a boolean result which is true if the region
overlaps a reserved region. However, the implementation actually
returns -1 if there is no overlap, and a region index (0 based)
if there is.

Make it behave as callers (and common sense) expect.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
mm/memblock.c

index 3024eb30fc273ea11e076878047a07d798d6b936..43840b305ecb2c01ac478d1c3c67aff7993016a7 100644 (file)
@@ -504,7 +504,7 @@ int __init memblock_is_reserved(u64 addr)
 
 int memblock_is_region_reserved(u64 base, u64 size)
 {
-       return memblock_overlaps_region(&memblock.reserved, base, size);
+       return memblock_overlaps_region(&memblock.reserved, base, size) >= 0;
 }
 
 /*