selftests/bpf: eliminate warning of get_cgroup_id_from_path()
authorJason Xing <kernelxing@tencent.com>
Sat, 6 Apr 2024 14:46:13 +0000 (22:46 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Mon, 8 Apr 2024 23:31:18 +0000 (16:31 -0700)
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.

Signed-off-by: Jason Xing <kernelxing@tencent.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20240406144613.4434-1-kerneljasonxing@gmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/cgroup_helpers.c

index 19be9c63d5e84c313cebf15bd498098a34c59963..f2952a65dcc2e616c1982b3a5acd6b3bed7530ef 100644 (file)
@@ -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 {