Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Fix unused attribute usage in subprogs_unused test

Correct attribute name is "unused". maybe_unused is a C++17 addition.
This patch fixes compilation warning during selftests compilation.

Fixes: 197afc631413 ("libbpf: Don't attempt to load unused subprog as an entry-point BPF program")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201111231215.1779147-1-andrii@kernel.org

authored by

Andrii Nakryiko and committed by
Alexei Starovoitov
fd63729c f16e6313

+2 -2
+2 -2
tools/testing/selftests/bpf/progs/test_subprogs_unused.c
··· 4 4 5 5 const char LICENSE[] SEC("license") = "GPL"; 6 6 7 - __attribute__((maybe_unused)) __noinline int unused1(int x) 7 + __attribute__((unused)) __noinline int unused1(int x) 8 8 { 9 9 return x + 1; 10 10 } 11 11 12 - static __attribute__((maybe_unused)) __noinline int unused2(int x) 12 + static __attribute__((unused)) __noinline int unused2(int x) 13 13 { 14 14 return x + 2; 15 15 }