From: Kamalesh Babulal Date: Wed, 16 Mar 2022 15:54:28 +0000 (+0530) Subject: samples/get_all_controller.c: fix checkpatch.pl warnings X-Git-Tag: v3.0~156 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=412a52ed69b3d3db52984dfc7fb3e8bd7d1a8070;p=thirdparty%2Flibcgroup.git samples/get_all_controller.c: fix checkpatch.pl warnings 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 Signed-off-by: Tom Hromatka --- diff --git a/samples/c/get_all_controller.c b/samples/c/get_all_controller.c index 873dfce7..8695fb55 100644 --- a/samples/c/get_all_controller.c +++ b/samples/c/get_all_controller.c @@ -1,13 +1,14 @@ // SPDX-License-Identifier: LGPL-2.1-only #include -#include + #include +#include -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); } }