linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/13] seq_file: rewrite seq_puts() in terms of seq_write()
@ 2018-08-27 23:14 Alexey Dobriyan
  2018-08-27 23:14 ` [PATCH 02/13] proc: apply seq_puts() whenever possible Alexey Dobriyan
                   ` (13 more replies)
  0 siblings, 14 replies; 24+ messages in thread
From: Alexey Dobriyan @ 2018-08-27 23:14 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, Alexey Dobriyan

Space savings -- 42 bytes!

	seq_puts	71      29     [-42]

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
 fs/seq_file.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/fs/seq_file.c b/fs/seq_file.c
index 1dea7a8a5255..0c282a88a896 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -653,14 +653,7 @@ EXPORT_SYMBOL(seq_putc);
 
 void seq_puts(struct seq_file *m, const char *s)
 {
-	int len = strlen(s);
-
-	if (m->count + len >= m->size) {
-		seq_set_overflow(m);
-		return;
-	}
-	memcpy(m->buf + m->count, s, len);
-	m->count += len;
+	seq_write(m, s, strlen(s));
 }
 EXPORT_SYMBOL(seq_puts);
 
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2018-09-03 14:18 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-27 23:14 [PATCH 01/13] seq_file: rewrite seq_puts() in terms of seq_write() Alexey Dobriyan
2018-08-27 23:14 ` [PATCH 02/13] proc: apply seq_puts() whenever possible Alexey Dobriyan
2018-08-27 23:14 ` [PATCH 03/13] proc: rename "p" variable in proc_readfd_common() Alexey Dobriyan
2018-08-27 23:14 ` [PATCH 04/13] proc: rename "p" variable in proc_map_files_readdir() Alexey Dobriyan
2018-08-27 23:14 ` [PATCH 05/13] proc: new and improved way to print decimals Alexey Dobriyan
2018-08-27 23:14 ` [PATCH 06/13] proc: convert /proc/self to _print_integer() Alexey Dobriyan
2018-08-29  9:50   ` David Laight
2018-08-30 13:13     ` Alexey Dobriyan
2018-08-27 23:14 ` [PATCH 07/13] proc: convert /proc/thread-self " Alexey Dobriyan
2018-08-27 23:14 ` [PATCH 08/13] proc: convert /proc/*/fd " Alexey Dobriyan
2018-08-27 23:14 ` [PATCH 09/13] proc: convert dentry flushing on exit " Alexey Dobriyan
2018-08-27 23:15 ` [PATCH 10/13] proc: convert readdir /proc " Alexey Dobriyan
2018-08-27 23:15 ` [PATCH 11/13] proc: readdir /proc/*/task Alexey Dobriyan
2018-08-28 12:36   ` Ahmed S. Darwish
2018-08-28 13:04     ` Ahmed S. Darwish
2018-08-28 19:35       ` Alexey Dobriyan
2018-08-29 23:43         ` Andrew Morton
2018-08-30 13:20           ` Alexey Dobriyan
2018-08-28 19:31     ` Alexey Dobriyan
2018-08-27 23:15 ` [PATCH 12/13] proc: convert /proc/*/statm to _print_integer() Alexey Dobriyan
2018-08-27 23:15 ` [PATCH 13/13] proc: convert /proc/*/task/*/children " Alexey Dobriyan
2018-08-28 18:24 ` [PATCH 01/13] seq_file: rewrite seq_puts() in terms of seq_write() Joe Perches
2018-08-28 20:48   ` Joe Perches
2018-09-03 14:17 ` Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).