From 3501d8ceed29f3d50dc780486c12cf2433062885 Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Wed, 16 Mar 2022 21:35:16 +0530 Subject: [PATCH] samples/proctest.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: 0 errors, 1 warnings, 55 lines checked Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- samples/c/proctest.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/samples/c/proctest.c b/samples/c/proctest.c index a3c2286d..8f8007f8 100644 --- a/samples/c/proctest.c +++ b/samples/c/proctest.c @@ -5,24 +5,26 @@ * Author: Ken'ichi Ohmichi */ +#include "../src/libcgroup-internal.h" + #include #include -#include "../src/libcgroup-internal.h" int main(int argc, char *argv[]) { - int i; - int ret; + char *procname; pid_t pid; uid_t uid; gid_t gid; - char *procname; + int ret; + int i; if (argc < 2) { printf("Specify process-id.\n"); return 1; } - printf(" Pid | Process name | Uid | Gid \n"); + + printf(" Pid | Process name | Uid | Gid\n"); printf("-------+----------------------------------+-------+-------\n"); for (i = 1; i < argc; i++) { @@ -41,5 +43,6 @@ int main(int argc, char *argv[]) printf("%6d | %32s | %5d | %5d\n", pid, procname, uid, gid); free(procname); } + return 0; } -- 2.47.2