> bpf: Add bpf_text_poke_batch() helper in trampoline
TL;DR: The new static bpf_text_poke_batch() has no caller in this patch, so it
may trigger -Wunused-function and, with CONFIG_WERROR=y, break the build and
bisection; consider squashing it or marking __maybe_unused.
> diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
> index 21d460866dfe..a2fd0bd8c685 100644
> --- a/kernel/bpf/trampoline.c
> +++ b/kernel/bpf/trampoline.c
[ ... ]
> @@ -1863,6 +1864,56 @@ void bpf_trampoline_multi_detach(struct bpf_prog *prog,
> CONFIG_HAVE_SINGLE_FTRACE_DIRECT_OPS &&
> CONFIG_BPF_SYSCALL */
>
> +static int bpf_text_poke_cmp(const void *a, const void *b)
> +{
[ ... ]
> +static int bpf_text_poke_batch(struct bpf_text_poke **pokes, u32 cnt)
> +{
bpf_text_poke_batch() is static and nothing calls it in this commit. Will
this trigger a -Wunused-function warning for any config that builds
trampoline.o?
kernel/bpf/trampoline.c: warning: 'bpf_text_poke_batch' defined but not
used [-Wunused-function]
With CONFIG_WERROR=y that becomes a build failure, which would break
bisection at this point in the series.
The first callers, bpf_trampoline_multi_prog_attach() and
bpf_trampoline_multi_prog_detach(), only arrive later in the series in
59e80b53cc6b ("bpf: Add bpf_trampoline_multi_prog_attach/detach()"). That
commit also wraps these helpers in #ifdef CONFIG_BPF_SYSCALL so they are not
unused in !CONFIG_BPF_SYSCALL builds.
Could this helper be squashed into the commit that adds its first user? If
it stays separate, could it be marked __maybe_unused until that user arrives?
> + int i, err;
> +
> + /*
> + * Sort pokes for two purposes:
[ ... ]
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/38273555988