selftests/bpf: make 'dubious pointer arithmetic' test useful
authorAlexei Starovoitov <ast@kernel.org>
Mon, 31 May 2021 18:25:52 +0000 (18:25 +0000)
committerCosmin Tanislav <demonsingur@gmail.com>
Thu, 16 May 2024 07:58:24 +0000 (10:58 +0300)
commitae82ea7f629a5d59c368e943354cea1da5d167be
treef1d1ba987cf33d42593f5f56d343bf76d8190db7
parent6e7ab8dcf6f0bae1970dd8d85e67f4ee4aa4c87e
selftests/bpf: make 'dubious pointer arithmetic' test useful

commit 31e95b61e172144bb2b626a291db1bdc0769275b upstream.

mostly revert the previous workaround and make
'dubious pointer arithmetic' test useful again.
Use (ptr - ptr) << const instead of ptr << const to generate large scalar.
The rest stays as before commit 2b36047e7889.

Fixes: 2b36047e7889 ("selftests/bpf: fix test_align")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
[fllinden@amazon.com: adjust for 4.14 (no liveness of regs in output)]
Signed-off-by: Frank van der Linden <fllinden@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/test_align.c