powerpc/pseries: fail quicker in dlpar_memory_add_by_ic()
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Tue, 22 Jun 2021 13:39:23 +0000 (10:39 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 24 Jun 2021 14:07:09 +0000 (00:07 +1000)
commit0e5962b2ec3d07204fd995ed07870bff3322525c
treefc8c822422adf59177b20dff4f32a71ba2879e47
parentc2aaddcc65b343fad4ed184e625abd3e68f63b9b
powerpc/pseries: fail quicker in dlpar_memory_add_by_ic()

The validation done at the start of dlpar_memory_add_by_ic() is an all
of nothing scenario - if any LMBs in the range is marked as RESERVED we
can fail right away.

We then can remove the 'lmbs_available' var and its check with
'lmbs_to_add' since the whole LMB range was already validated in the
previous step.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210622133923.295373-4-danielhb413@gmail.com
arch/powerpc/platforms/pseries/hotplug-memory.c