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>
// 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();
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);
}
}