From: Kamalesh Babulal Date: Wed, 16 Mar 2022 16:09:07 +0000 (+0530) Subject: samples/test_named_hierarchy.c: fix checkpatch.pl warnings X-Git-Tag: v3.0~147 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b007e8a894b0df4e1eb3d03be37483476571af17;p=thirdparty%2Flibcgroup.git samples/test_named_hierarchy.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, 47 lines checked Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/samples/c/test_named_hierarchy.c b/samples/c/test_named_hierarchy.c index d42cf3e5..c0bf7eeb 100644 --- a/samples/c/test_named_hierarchy.c +++ b/samples/c/test_named_hierarchy.c @@ -1,23 +1,24 @@ // SPDX-License-Identifier: LGPL-2.1-only -#include +#include + #include #include -#include +#include /* * 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); }