From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH iproute2] lib/bpf: fix build warning if no elf Date: Mon, 10 Dec 2018 13:51:11 -0800 Message-ID: <20181210215110.5620-1-stephen@networkplumber.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Stephen Hemminger To: netdev@vger.kernel.org Return-path: Received: from mail-pg1-f194.google.com ([209.85.215.194]:35177 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726392AbeLJVv1 (ORCPT ); Mon, 10 Dec 2018 16:51:27 -0500 Received: by mail-pg1-f194.google.com with SMTP id s198so5603676pgs.2 for ; Mon, 10 Dec 2018 13:51:27 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: 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 --- lib/bpf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/bpf.c b/lib/bpf.c index 6aff8f7bad7f..5e85cfc0bdd5 100644 --- a/lib/bpf.c +++ b/lib/bpf.c @@ -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) -- 2.19.2