> diff --git a/tools/testing/selftests/bpf/bpf_experimental.h
> b/tools/testing/selftests/bpf/bpf_experimental.h
> --- a/tools/testing/selftests/bpf/bpf_experimental.h
> +++ b/tools/testing/selftests/bpf/bpf_experimental.h
[ ... ]
> +/* Description
> + * Insert 'node' after 'prev' in the BPF linked list. Both must be in the
> + * same list; 'prev' must be in the list. The 'meta' and 'off' parameters
^^^^
The description says "Both must be in the same list" but looking at
__bpf_list_add_after() in kernel/bpf/helpers.c, the implementation
requires node->owner to be NULL via cmpxchg:
if (cmpxchg(&node->owner, NULL, BPF_PTR_POISON))
goto fail;
This means 'node' must not already be in any list. The Returns
section below correctly says "-EINVAL if ... node is already in a
list," which contradicts the Description.
Should this instead say something like "'prev' must already be in a
list; 'node' must not be in any list"?
> + * are rewritten by the verifier, no need for BPF programs to set them.
> + * Returns
> + * 0 on success, -EINVAL if prev is not in a list or node is already in a
> list.
> + */
> +extern int bpf_list_add_impl(struct bpf_list_node *prev, struct
> bpf_list_node *node,
> + void *meta, __u64 off) __ksym;
[ ... ]
---
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/22391130139
AI-authorship-score: low
AI-authorship-explanation: Code follows established BPF selftest patterns and
the doc comment error is characteristic of human imprecision rather than AI
generation.
issues-found: 1
issue-severity-score: low
issue-severity-explanation: Inaccurate API doc comment in selftest header
contradicts implementation semantics but does not cause runtime failures.