UPSTREAM: arm64: module: avoid undefined shift behavior in reloc_data()

Compilers may engage the improbability drive when encountering shifts
by a distance that is a multiple of the size of the operand type. Since
the required bounds check is very simple here, we can get rid of all the
fuzzy masking, shifting and comparing, and use the documented bounds
directly.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>

Bug: None
Patchset: arm64-kmod-loading-fixes

(cherry-picked from f930896967fa3f9ab16a6f87267b92798308d48f)
Signed-off-by: Mattias Nissler <mnissler@google.com>

Change-Id: I4edb68cd15f7a41dd42c3b6480c688183b853430
1 file changed