summaryrefslogtreecommitdiff
path: root/fs/seq_file.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2024-04-22 13:24:07 +0300
committerChristian Brauner <brauner@kernel.org>2024-05-02 17:28:20 +0300
commite035af9f6ebacd98774b1be2af58a5afd6d0d291 (patch)
treeeb2f210e060b44674d6b790dcda401f88a340fdc /fs/seq_file.c
parent45751097aeb386eb239f6a8ed0ccfd7dabce068e (diff)
downloadlinux-e035af9f6ebacd98774b1be2af58a5afd6d0d291.tar.xz
seq_file: Simplify __seq_puts()
Change the implementation of the out-of-line __seq_puts() to simply be a seq_write() call instead of duplicating the overflow/memcpy logic. Suggested-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/7cebc1412d8d1338a7e52cc9291d00f5368c14e4.1713781332.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/seq_file.c')
-rw-r--r--fs/seq_file.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 8ef0a07033ca..e676c8b0cf5d 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -671,14 +671,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);