Skip to contentSkip to conversation

selftests/bpf: eliminate warning of get_cgroup_id_from_path()

PATCH Applied Jason Xing 3 participants 3 messages Apr 6, 2024 – Apr 9, 2024

Subsystems (5)
lore
Share & tools
lore

Jason Xing

author
#0 lore raw

PATCH 1/1 selftests/bpf: eliminate warning of get_cgroup_id_from_path()

From: Jason Xing <[email protected]>

The output goes like this if I make samples/bpf:
...warning: no previous prototype for ‘get_cgroup_id_from_path’...

Make this function static could solve the warning problem since no one outside of the file calls it.

---
 tools/testing/selftests/bpf/cgroup_helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/cgroup_helpers.c +1 -1
index 19be9c63d5e8..f2952a65dcc2 100644
@@ -429,7 +429,7 @@ int create_and_get_cgroup(const char *relative_path)
  * which is an invalid cgroup id.
  * If there is a failure, it prints the error to stderr.
  */
-unsigned long long get_cgroup_id_from_path(const char *cgroup_workdir)
+static unsigned long long get_cgroup_id_from_path(const char *cgroup_workdir)
 {
 	int dirfd, err, flags, mount_id, fhsize;
 	union {
Signature · 1 line
2.37.3
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Jason Xing

From: Jason Xing <[email protected]>

The output goes like this if I make samples/bpf:
...warning: no previous prototype for ‘get_cgroup_id_from_path’...

The CI does not build samples/bpf...

Quoted 5 lines

Make this function static could solve the warning problem since no one outside of the file calls it.

But your change looks fine.

#2 lore raw
In reply to Jason Xing
This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:

Quoted 9 lines · On Sat, 6 Apr 2024 22:46:13 +0800 you wrote:

From: Jason Xing <[email protected]>

The output goes like this if I make samples/bpf:
...warning: no previous prototype for ‘get_cgroup_id_from_path’...

Make this function static could solve the warning problem since no one outside of the file calls it.

[...]

Here is the summary with links:
- [net-next] selftests/bpf: eliminate warning of get_cgroup_id_from_path()

    https://git.kernel.org/bpf/bpf-next/c/bb761fcb8217

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html