]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
samples/get_mount_point.c: fix checkpatch.pl warnings
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 16 Mar 2022 15:57:25 +0000 (21:27 +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, 1 warnings, 49 lines checked

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

index 55f2066237fd013b4cd60077925746212faf8cfc..788500744dfa9a773526dc3915d3ce3fef8303a2 100644 (file)
@@ -1,15 +1,16 @@
 // SPDX-License-Identifier: LGPL-2.1-only
 #include <libcgroup.h>
-#include <stdio.h>
+
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <stdio.h>
 
-int main()
+int main(void)
 {
-       int ret;
        char *mount_point;
        char string[100];
+       int ret;
 
        strcpy(string, "cpu");
 
@@ -22,7 +23,7 @@ int main()
        ret = cgroup_get_subsys_mount_point(string, &mount_point);
        if (ret) {
                printf("get_mount_point failed with %s\n",
-                                       cgroup_strerror(ret));
+                      cgroup_strerror(ret));
                exit(3);
        }
 
@@ -32,10 +33,9 @@ int main()
        strcpy(string, "obviouslynonexistsubsys");
 
        ret = cgroup_get_subsys_mount_point(string, &mount_point);
-
        if (!ret) {
-               printf("get_mount_point failed as it got a "
-                                       "non existant subsys\n");
+               printf("get_mount_point failed as it got a ");
+               printf("non existent subsys\n");
                exit(3);
        }