hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/tools/testing/selftests/bpf/test_dev_cgroup.c
....@@ -1,8 +1,5 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* Copyright (c) 2017 Facebook
2
- *
3
- * This program is free software; you can redistribute it and/or
4
- * modify it under the terms of version 2 of the GNU General Public
5
- * License as published by the Free Software Foundation.
63 */
74
85 #include <stdio.h>
....@@ -36,21 +33,10 @@
3633 goto out;
3734 }
3835
39
- if (setup_cgroup_environment()) {
40
- printf("Failed to load DEV_CGROUP program\n");
41
- goto err;
42
- }
43
-
44
- /* Create a cgroup, get fd, and join it */
45
- cgroup_fd = create_and_get_cgroup(TEST_CGROUP);
46
- if (!cgroup_fd) {
36
+ cgroup_fd = cgroup_setup_and_join(TEST_CGROUP);
37
+ if (cgroup_fd < 0) {
4738 printf("Failed to create test cgroup\n");
48
- goto err;
49
- }
50
-
51
- if (join_cgroup(TEST_CGROUP)) {
52
- printf("Failed to join cgroup\n");
53
- goto err;
39
+ goto out;
5440 }
5541
5642 /* Attach bpf program */