提交 214ab1b8 编写于 作者: A Alexei Starovoitov 提交者: Zheng Zengkai

bpf: Silence purge_cand_cache build warning.

mainline inclusion
from mainline-5.17-rc1
commit 29f2e5bd
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=29f2e5bd9439445fe14ba8570b1c9a7ad682df84

-------------------------------------------------

When CONFIG_DEBUG_INFO_BTF_MODULES is not set
the following warning can be seen:
kernel/bpf/btf.c:6588:13: warning: 'purge_cand_cache' defined but not used [-Wunused-function]
Fix it.

Fixes: 1e89106d ("bpf: Add bpf_core_add_cands() and wire it into bpf_core_apply_relo_insn().")
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211207014839.6976-1-alexei.starovoitov@gmail.com
(cherry picked from commit 29f2e5bd)
Signed-off-by: NWang Yufen <wangyufen@huawei.com>
上级 4e78715d
......@@ -6430,6 +6430,7 @@ static struct bpf_cand_cache *populate_cand_cache(struct bpf_cand_cache *cands,
return new_cands;
}
#ifdef CONFIG_DEBUG_INFO_BTF_MODULES
static void __purge_cand_cache(struct btf *btf, struct bpf_cand_cache **cache,
int cache_size)
{
......@@ -6468,6 +6469,7 @@ static void purge_cand_cache(struct btf *btf)
__purge_cand_cache(btf, module_cand_cache, MODULE_CAND_CACHE_SIZE);
mutex_unlock(&cand_cache_mutex);
}
#endif
static struct bpf_cand_cache *
bpf_core_add_cands(struct bpf_cand_cache *cands, const struct btf *targ_btf,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册