diff mbox series

selftests/bpf: declare subprog_noise as static in tailcall_bpf2bpf4

Message ID 20220826035141.737919-1-james.hilliard1@gmail.com (mailing list archive)
State Accepted
Commit b05d64efbb21ad231516b44317af34d2b586cfc4
Delegated to: BPF
Headers show
Series selftests/bpf: declare subprog_noise as static in tailcall_bpf2bpf4 | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next-VM_Test-4 success Logs for llvm-toolchain
bpf/vmtest-bpf-next-VM_Test-5 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-2 success Logs for build for x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-3 success Logs for build for x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-1 success Logs for build for s390x with gcc
bpf/vmtest-bpf-next-VM_Test-7 success Logs for test_maps on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-16 success Logs for test_verifier on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-8 success Logs for test_maps on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-13 success Logs for test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-17 success Logs for test_verifier on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-10 success Logs for test_progs on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-11 success Logs for test_progs on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-14 success Logs for test_progs_no_alu32 on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-6 success Logs for test_maps on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-12 success Logs for test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-15 success Logs for test_verifier on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-9 success Logs for test_progs on s390x with gcc

Commit Message

James Hilliard Aug. 26, 2022, 3:51 a.m. UTC
Due to bpf_map_lookup_elem being declared static we need to also
declare subprog_noise as static.

Fixes the following error:
progs/tailcall_bpf2bpf4.c:26:9: error: 'bpf_map_lookup_elem' is static but used in inline function 'subprog_noise' which is not static [-Werror]
   26 |         bpf_map_lookup_elem(&nop_table, &key);
      |         ^~~~~~~~~~~~~~~~~~~

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 tools/testing/selftests/bpf/progs/tailcall_bpf2bpf4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Song Liu Aug. 26, 2022, 4:44 a.m. UTC | #1
On Thu, Aug 25, 2022 at 8:52 PM James Hilliard
<james.hilliard1@gmail.com> wrote:
>
> Due to bpf_map_lookup_elem being declared static we need to also
> declare subprog_noise as static.
>
> Fixes the following error:
> progs/tailcall_bpf2bpf4.c:26:9: error: 'bpf_map_lookup_elem' is static but used in inline function 'subprog_noise' which is not static [-Werror]
>    26 |         bpf_map_lookup_elem(&nop_table, &key);
>       |         ^~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>

Acked-by: Song Liu <song@kernel.org>

> ---
>  tools/testing/selftests/bpf/progs/tailcall_bpf2bpf4.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf4.c b/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf4.c
> index b67e8022d500..a017d6b2f1dd 100644
> --- a/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf4.c
> +++ b/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf4.c
> @@ -19,7 +19,7 @@ struct {
>  int count = 0;
>  int noise = 0;
>
> -__always_inline int subprog_noise(void)
> +static __always_inline int subprog_noise(void)
>  {
>         __u32 key = 0;
>
> --
> 2.34.1
>
patchwork-bot+netdevbpf@kernel.org Aug. 27, 2022, 5:10 a.m. UTC | #2
Hello:

This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Thu, 25 Aug 2022 21:51:39 -0600 you wrote:
> Due to bpf_map_lookup_elem being declared static we need to also
> declare subprog_noise as static.
> 
> Fixes the following error:
> progs/tailcall_bpf2bpf4.c:26:9: error: 'bpf_map_lookup_elem' is static but used in inline function 'subprog_noise' which is not static [-Werror]
>    26 |         bpf_map_lookup_elem(&nop_table, &key);
>       |         ^~~~~~~~~~~~~~~~~~~
> 
> [...]

Here is the summary with links:
  - selftests/bpf: declare subprog_noise as static in tailcall_bpf2bpf4
    https://git.kernel.org/bpf/bpf-next/c/b05d64efbb21

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf4.c b/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf4.c
index b67e8022d500..a017d6b2f1dd 100644
--- a/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf4.c
+++ b/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf4.c
@@ -19,7 +19,7 @@  struct {
 int count = 0;
 int noise = 0;
 
-__always_inline int subprog_noise(void)
+static __always_inline int subprog_noise(void)
 {
 	__u32 key = 0;