[RESEND PATCH v5 3/4] memblock: extend memblock_cap_memory_range to multiple ranges

2019-04-16 Thread Chen Zhou
From: Mike Rapoport The memblock_cap_memory_range() removes all the memory except the range passed to it. Extend this function to receive an array of memblock_regions that should be kept. This allows switching to simple iteration over memblock arrays with 'for_each_mem_range_rev' to remove the

[PATCH v5 3/4] memblock: extend memblock_cap_memory_range to multiple ranges

2019-04-16 Thread Chen Zhou
The memblock_cap_memory_range() removes all the memory except the range passed to it. Extend this function to receive an array of memblock_regions that should be kept. This allows switching to simple iteration over memblock arrays with 'for_each_mem_range_rev' to remove the unneeded memory.