proc: faster /proc/cmdline
authorAlexey Dobriyan <adobriyan@gmail.com>
Tue, 10 Apr 2018 23:32:01 +0000 (16:32 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Apr 2018 17:28:34 +0000 (10:28 -0700)
Use seq_puts() and skip format string processing.

Link: http://lkml.kernel.org/r/20180309222948.GB3843@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/cmdline.c

index 403cbb12a6e9b428fb56f0767492a0dd3acde536..8233e7af9389dc8316e71a4f42e0206a6ceb5e9b 100644 (file)
@@ -6,7 +6,8 @@
 
 static int cmdline_proc_show(struct seq_file *m, void *v)
 {
-       seq_printf(m, "%s\n", saved_command_line);
+       seq_puts(m, saved_command_line);
+       seq_putc(m, '\n');
        return 0;
 }