powerpc/code-patching: Fix unmap_patch_area() error handling
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 2 Dec 2021 12:00:20 +0000 (13:00 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Dec 2021 11:35:24 +0000 (22:35 +1100)
commita3483c3dd18c136785a31406fe27210649fc4fba
treeb7893804ec9882ee7138335a10bd6d6803998aab
parent285672f99327d5b8febdf83cadba61a68abe5d69
powerpc/code-patching: Fix unmap_patch_area() error handling

pXd_offset() doesn't return NULL. When the base is NULL, it
still adds the offset.

Use pXd_none() to check validity instead. It also improves
performance by folding out none existing levels as pXd_none()
always returns 0 in that case.

Such an error is unexpected, use WARN_ON() so that the caller
doesn't have to worry about it, and drop the returned value.

And now that unmap_patch_area() doesn't return error, we can
take into account the error returned by __patch_instruction().

While at it, remove the 'inline' property which is useless.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/299804b117fae35c786c827536c91f25352e279b.1638446239.git.christophe.leroy@csgroup.eu
arch/powerpc/lib/code-patching.c