BPF List
 help / color / mirror / Atom feed
From: Ryota Sakamoto <sakamo.ryota@gmail.com>
To: "Tejun Heo" <tj@kernel.org>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Michal Koutný" <mkoutny@suse.com>
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	 bpf@vger.kernel.org, Ryota Sakamoto <sakamo.ryota@gmail.com>
Subject: [PATCH] cgroup/rstat: fix missing prototype warning for bpf_rstat_flush()
Date: Fri, 16 Jan 2026 03:12:14 +0900	[thread overview]
Message-ID: <20260116-fix-bpf_rstat_flush-v1-1-b068c230fdff@gmail.com> (raw)

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>


             reply	other threads:[~2026-01-15 18:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 18:12 Ryota Sakamoto [this message]
2026-01-15 18:45 ` [PATCH] cgroup/rstat: fix missing prototype warning for bpf_rstat_flush() Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260116-fix-bpf_rstat_flush-v1-1-b068c230fdff@gmail.com \
    --to=sakamo.ryota@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkoutny@suse.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox