Skip to content

Commit

Permalink
memblock: Fix memblock_is_region_reserved() to return a boolean
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Herrenschmidt committed Aug 4, 2010
1 parent 3a09b1b commit f1c2c19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/memblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit f1c2c19

Please sign in to comment.