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

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

index 873dfce7a4b4af4d83f971d41fb58279cfee7e30..8695fb552fcdf83a891278b34be813d8a509ad5f 100644 (file)
@@ -1,13 +1,14 @@
 // SPDX-License-Identifier: LGPL-2.1-only
 #include <libcgroup.h>
-#include <stdio.h>
+
 #include <stdlib.h>
+#include <stdio.h>
 
-int main()
+int main(void)
 {
-       int error;
-       void *handle;
        struct controller_data info;
+       void *handle;
+       int error;
 
        error = cgroup_init();
 
@@ -24,7 +25,7 @@ int main()
                error = cgroup_get_all_controller_next(&handle, &info);
                if (error && error != ECGEOF) {
                        printf("cgroup_get_controller_next failed with %s\n",
-                                                       cgroup_strerror(error));
+                              cgroup_strerror(error));
                        exit(1);
                }
        }