powerpc/pseries: minor enhancements in dlpar_memory_remove_by_ic()
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Wed, 12 May 2021 20:28:09 +0000 (17:28 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 23 May 2021 10:51:35 +0000 (20:51 +1000)
commit40999b041e03b32434b2f4a951668e9865a3cb6b
tree1b2d25d42b4c02482d31f4b2d43738d4bf9e2ef8
parent163e7921750f6cd965666f472c21de056c63dcbc
powerpc/pseries: minor enhancements in dlpar_memory_remove_by_ic()

We don't need the 'lmbs_available' variable to count the valid LMBs and
to check if we have less than 'lmbs_to_remove'. We must ensure that the
entire LMB range must be removed, so we can error out immediately if any
LMB in the range is marked as reserved.

Add a couple of comments explaining the reasoning behind the differences
we have in this function in contrast to what it is done in its sister
function, dlpar_memory_remove_by_count().

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210512202809.95363-5-danielhb413@gmail.com
arch/powerpc/platforms/pseries/hotplug-memory.c