diff mbox series

[bpf-next] bpf: Silence purge_cand_cache build warning.

Message ID 20211207014839.6976-1-alexei.starovoitov@gmail.com (mailing list archive)
State Accepted
Commit 29f2e5bd9439445fe14ba8570b1c9a7ad682df84
Delegated to: BPF
Headers show
Series [bpf-next] bpf: Silence purge_cand_cache build warning. | expand

Checks

Context Check Description
bpf/vmtest-bpf-next success VM_Test
bpf/vmtest-bpf-next-PR success PR summary
netdev/tree_selection success Clearly marked for bpf-next
netdev/apply success Patch already applied to bpf-next

Commit Message

Alexei Starovoitov Dec. 7, 2021, 1:48 a.m. UTC
From: Alexei Starovoitov <ast@kernel.org>

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>
---
 kernel/bpf/btf.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org Dec. 7, 2021, 3:20 a.m. UTC | #1
Hello:

This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Mon,  6 Dec 2021 17:48:39 -0800 you wrote:
> From: Alexei Starovoitov <ast@kernel.org>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - [bpf-next] bpf: Silence purge_cand_cache build warning.
    https://git.kernel.org/bpf/bpf-next/c/29f2e5bd9439

You are awesome, thank you!
diff mbox series

Patch

diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 36a5cc0f53c6..01b47d4df3ab 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -6560,6 +6560,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)
 {
@@ -6598,6 +6599,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,