fd63729cc0
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
22 lines
347 B
C
22 lines
347 B
C
#include "vmlinux.h"
|
|
#include <bpf/bpf_helpers.h>
|
|
#include <bpf/bpf_core_read.h>
|
|
|
|
const char LICENSE[] SEC("license") = "GPL";
|
|
|
|
__attribute__((unused)) __noinline int unused1(int x)
|
|
{
|
|
return x + 1;
|
|
}
|
|
|
|
static __attribute__((unused)) __noinline int unused2(int x)
|
|
{
|
|
return x + 2;
|
|
}
|
|
|
|
SEC("raw_tp/sys_enter")
|
|
int main_prog(void *ctx)
|
|
{
|
|
return 0;
|
|
}
|