Skip to content

Commit

Permalink
selftests/bpf: eliminate warning of get_cgroup_id_from_path()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin KaFai Lau <[email protected]>
  • Loading branch information
JasonXing authored and Martin KaFai Lau committed Apr 8, 2024
1 parent 50408d7 commit bb761fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/cgroup_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit bb761fc

Please sign in to comment.