Re: [PATCH] cgroup/rstat: fix missing prototype warning for bpf_rstat_flush()

From: Alexei Starovoitov

Date: Thu Jan 15 2026 - 13:46:12 EST


On Thu, Jan 15, 2026 at 10:34 AM Ryota Sakamoto <sakamo.ryota@xxxxxxxxx> wrote:
>
> Add the prototype to cgroup-internal.h to resolve the Sparse warning.
>
> The function bpf_rstat_flush() is defined as __weak and global in
> kernel/cgroup/rstat.c, but lack of prototype in header file causes warning
> with Sparse (C=1):
>
> kernel/cgroup/rstat.c:342:22: warning: symbol 'bpf_rstat_flush' was not declared. Should it be static?

No. Ignore the warning. Sparse is incorrect.
We have hundreds of such bogus warnings. Do NOT attempt to send
more patches to "fix" them.

pw-bot: cr