mm/memblock.c: trivial code refine in memblock_is_region_memory()
authorWei Yang <[email protected]>
Wed, 22 Feb 2017 23:45:04 +0000 (15:45 -0800)
committerLinus Torvalds <[email protected]>
Thu, 23 Feb 2017 00:41:29 +0000 (16:41 -0800)
commitef415ef41153b747031e8ad965cb3df4f22ff72e
treef1fe360440def0dff05ae3e60a101c11b4d56d41
parent399d8eebe768fe3ae648700547d04f2a8796a4da
mm/memblock.c: trivial code refine in memblock_is_region_memory()

memblock_is_region_memory() invoke memblock_search() to see whether the
base address is in the memory region.  If it fails, idx would be -1.
Then, it returns 0.

If the memblock_search() returns a valid index, it means the base
address is guaranteed to be in the range memblock.memory.regions[idx].
Because of this, it is not necessary to check the base again.

This patch removes the check on "base".

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Wei Yang <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/memblock.c