]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftest/bpf: Adapt inline asm operand constraint for GCC support
authorCupertino Miranda <cupertino.miranda@oracle.com>
Mon, 19 Aug 2024 15:11:29 +0000 (16:11 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 19 Aug 2024 22:30:29 +0000 (15:30 -0700)
commitd9075ac631ce0c5c2c17aa6221282a7c4ba8fa70
tree12748c4e176d443b714176f6ecbbe384e11aef91
parent2aa93695081d4bd62350b41d58684d802be4563f
selftest/bpf: Adapt inline asm operand constraint for GCC support

GCC errors when compiling tailcall_bpf2bpf_hierarchy2.c and
tailcall_bpf2bpf_hierarchy3.c with the following error:

progs/tailcall_bpf2bpf_hierarchy2.c: In function 'tailcall_bpf2bpf_hierarchy_2':
progs/tailcall_bpf2bpf_hierarchy2.c:66:9: error: input operand constraint contains '+'
   66 |         asm volatile (""::"r+"(ret));
      |         ^~~

Changed implementation to make use of __sink macro that abstracts the
desired behaviour.

The proposed change seems valid for both GCC and CLANG.

Signed-off-by: Cupertino Miranda <cupertino.miranda@oracle.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240819151129.1366484-4-cupertino.miranda@oracle.com
tools/testing/selftests/bpf/progs/tailcall_bpf2bpf_hierarchy2.c
tools/testing/selftests/bpf/progs/tailcall_bpf2bpf_hierarchy3.c