lib/bpf: fix build warning if no elf

Function was not used unlesss HAVE_ELF causing:

bpf.c:105:13: warning: ‘bpf_map_offload_neutral’ defined but not used [-Wunused-function]

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Stephen Hemminger 2018-12-10 13:50:17 -08:00
parent 79940533c0
commit 33fde2b600
1 changed files with 5 additions and 5 deletions

View File

@ -102,11 +102,6 @@ static const struct bpf_prog_meta __bpf_prog_meta[] = {
},
};
static bool bpf_map_offload_neutral(enum bpf_map_type type)
{
return type == BPF_MAP_TYPE_PERF_EVENT_ARRAY;
}
static const char *bpf_prog_to_subdir(enum bpf_prog_type type)
{
assert(type < ARRAY_SIZE(__bpf_prog_meta) &&
@ -1610,6 +1605,11 @@ static bool bpf_is_map_in_map_type(const struct bpf_elf_map *map)
map->type == BPF_MAP_TYPE_HASH_OF_MAPS;
}
static bool bpf_map_offload_neutral(enum bpf_map_type type)
{
return type == BPF_MAP_TYPE_PERF_EVENT_ARRAY;
}
static int bpf_map_attach(const char *name, struct bpf_elf_ctx *ctx,
const struct bpf_elf_map *map, struct bpf_map_ext *ext,
int *have_map_in_map)