From: Kamalesh Babulal Date: Wed, 16 Mar 2022 16:05:16 +0000 (+0530) Subject: samples/proctest.c: fix checkpatch.pl warnings X-Git-Tag: v3.0~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3501d8ceed29f3d50dc780486c12cf2433062885;p=thirdparty%2Flibcgroup.git 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 --- 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; }