From ddac1f48710ba4161e46b328d004587918697dcd Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Wed, 16 Mar 2022 21:27:25 +0530 Subject: [PATCH] samples/get_mount_point.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, 1 warnings, 49 lines checked Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- samples/c/get_mount_point.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/c/get_mount_point.c b/samples/c/get_mount_point.c index 55f20662..78850074 100644 --- a/samples/c/get_mount_point.c +++ b/samples/c/get_mount_point.c @@ -1,15 +1,16 @@ // SPDX-License-Identifier: LGPL-2.1-only #include -#include + #include #include #include +#include -int main() +int main(void) { - int ret; char *mount_point; char string[100]; + int ret; strcpy(string, "cpu"); @@ -22,7 +23,7 @@ int main() 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); } @@ -32,10 +33,9 @@ int main() 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); } -- 2.47.2