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