From: Benjamin Herrenschmidt Date: Wed, 4 Aug 2010 04:17:17 +0000 (+1000) Subject: memblock: Fix memblock_is_region_reserved() to return a boolean X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2ed9aae0facd603f9f9b8347d1d7e9de23bde286;p=linux-beck.git memblock: Fix memblock_is_region_reserved() to return a boolean 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 --- diff --git a/mm/memblock.c b/mm/memblock.c index 3024eb30fc27..43840b305ecb 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -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; } /*