]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
samples/test_named_hierarchy.c: fix checkpatch.pl warnings
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 16 Mar 2022 16:09:07 +0000 (21:39 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 16 Mar 2022 21:38:20 +0000 (15:38 -0600)
Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 1 errors, 0 warnings, 47 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
samples/c/test_named_hierarchy.c

index d42cf3e56e38001fe655313db5b931add729eb4b..c0bf7eeba46e5cf1062ca1212935778b56e772a6 100644 (file)
@@ -1,23 +1,24 @@
 // SPDX-License-Identifier: LGPL-2.1-only
-#include <stdio.h>
+#include <libcgroup.h>
+
 #include <stdlib.h>
 #include <unistd.h>
-#include <libcgroup.h>
+#include <stdio.h>
 
 /*
  * Assumes cgroup is mounted at /cgroup using
- *
  * mount -t cgroup -o none,name=test none /cgroup
  */
-int main()
+int main(void)
 {
-       int ret;
-       struct cgroup *cgroup;
        struct cgroup_controller *cgc;
+       struct cgroup *cgroup;
+       int ret;
 
        ret = cgroup_init();
        if (ret) {
-               printf("FAIL: cgroup_init failed with %s\n", cgroup_strerror(ret));
+               printf("FAIL: cgroup_init failed with %s\n",
+                      cgroup_strerror(ret));
                exit(3);
        }
 
@@ -35,7 +36,8 @@ int main()
 
        ret = cgroup_create_cgroup(cgroup, 1);
        if (ret) {
-               printf("FAIL: cgroup_create_cgroup failed with %s\n", cgroup_strerror(ret));
+               printf("FAIL: cgroup_create_cgroup failed with %s\n",
+                      cgroup_strerror(ret));
                exit(3);
        }