]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Make test_translate_branch() independent of instruction length
authorJordan Niethe <jniethe5@gmail.com>
Wed, 6 May 2020 03:40:40 +0000 (13:40 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 18 May 2020 14:10:38 +0000 (00:10 +1000)
commit33d562fefb5c965dd5d8e6acfb9f0028d41f1d7f
tree862022b76f1c5bc7795344a8652cfc59d74f0cab
parent85e180b6a87c3b23c1e871a714837eb16905184c
powerpc: Make test_translate_branch() independent of instruction length

test_translate_branch() uses two pointers to instructions within a
buffer, p and q, to test patch_branch(). The pointer arithmetic done on
them assumes a size of 4. This will not work if the instruction length
changes. Instead do the arithmetic relative to the void * to the buffer.

Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Alistair Popple <alistair@popple.id.au>
Link: https://lore.kernel.org/r/20200506034050.24806-21-jniethe5@gmail.com
arch/powerpc/lib/code-patching.c