]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
samples/proctest.c: fix checkpatch.pl warnings
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 16 Mar 2022 16:05:16 +0000 (21:35 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 16 Mar 2022 21:38:20 +0000 (15:38 -0600)
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 <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
samples/c/proctest.c

index a3c2286d49bd7bfc78cbe61242a076499a7cebe2..8f8007f8a09e8f48234c395623d1009e6a4779f5 100644 (file)
@@ -5,24 +5,26 @@
  * Author:     Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
  */
 
+#include "../src/libcgroup-internal.h"
+
 #include <stdio.h>
 #include <stdlib.h>
-#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;
 }