Blob Blame History Raw
From: Alexei Starovoitov <ast@kernel.org>
Date: Mon, 6 Dec 2021 17:48:39 -0800
Subject: bpf: Silence purge_cand_cache build warning.
Patch-mainline: v5.17-rc1
Git-commit: 29f2e5bd9439445fe14ba8570b1c9a7ad682df84
References: jsc#PED-1368

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: 1e89106da253 ("bpf: Add bpf_core_add_cands() and wire it into bpf_core_apply_relo_insn().")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211207014839.6976-1-alexei.starovoitov@gmail.com
Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
---
 kernel/bpf/btf.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -6553,6 +6553,7 @@ static struct bpf_cand_cache *populate_c
 	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)
 {
@@ -6591,6 +6592,7 @@ static void purge_cand_cache(struct 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,