]> git.baikalelectronics.ru Git - kernel.git/commitdiff
fs/proc/base.c: slightly faster /proc/*/limits
authorAlexey Dobriyan <adobriyan@gmail.com>
Thu, 3 Jan 2019 23:26:09 +0000 (15:26 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Jan 2019 21:13:45 +0000 (13:13 -0800)
Header of /proc/*/limits is a fixed string, so print it directly without
formatting specifiers.

Link: http://lkml.kernel.org/r/20181203164242.GB6904@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/base.c

index 58a8dc3fd6c612ae005711f318769c03c0d31b82..633a6346257346595a71843092fb79efd71c14f8 100644 (file)
@@ -581,8 +581,10 @@ static int proc_pid_limits(struct seq_file *m, struct pid_namespace *ns,
        /*
         * print the file header
         */
-       seq_printf(m, "%-25s %-20s %-20s %-10s\n",
-                 "Limit", "Soft Limit", "Hard Limit", "Units");
+       seq_puts(m, "Limit                     "
+               "Soft Limit           "
+               "Hard Limit           "
+               "Units     \n");
 
        for (i = 0; i < RLIM_NLIMITS; i++) {
                if (rlim[i].rlim_cur == RLIM_INFINITY)