BPF List
 help / color / mirror / Atom feed
* [PATCH] cgroup/rstat: fix missing prototype warning for bpf_rstat_flush()
@ 2026-01-15 18:12 Ryota Sakamoto
  2026-01-15 18:45 ` Alexei Starovoitov
  0 siblings, 1 reply; 2+ messages in thread
From: Ryota Sakamoto @ 2026-01-15 18:12 UTC (permalink / raw)
  To: Tejun Heo, Johannes Weiner, Michal Koutný
  Cc: cgroups, linux-kernel, bpf, Ryota Sakamoto

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?

Signed-off-by: Ryota Sakamoto <sakamo.ryota@gmail.com>
---
 kernel/cgroup/cgroup-internal.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cgroup/cgroup-internal.h b/kernel/cgroup/cgroup-internal.h
index 22051b4f1ccbc0812641e4716b7a5b5f7138bbc9..ecb2b3a2f06ffcc3d747adf666a6134cc54059e1 100644
--- a/kernel/cgroup/cgroup-internal.h
+++ b/kernel/cgroup/cgroup-internal.h
@@ -277,6 +277,7 @@ int css_rstat_init(struct cgroup_subsys_state *css);
 void css_rstat_exit(struct cgroup_subsys_state *css);
 int ss_rstat_init(struct cgroup_subsys *ss);
 void cgroup_base_stat_cputime_show(struct seq_file *seq);
+void bpf_rstat_flush(struct cgroup *cgrp, struct cgroup *parent, int cpu);
 
 /*
  * namespace.c

---
base-commit: 944aacb68baf7624ab8d277d0ebf07f025ca137c
change-id: 20260116-fix-bpf_rstat_flush-66c1a7582b21

Best regards,
-- 
Ryota Sakamoto <sakamo.ryota@gmail.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-15 18:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-15 18:12 [PATCH] cgroup/rstat: fix missing prototype warning for bpf_rstat_flush() Ryota Sakamoto
2026-01-15 18:45 ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox