Skip to content

Commit e035af9

Browse files
tititiou36brauner
authored andcommitted
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 <[email protected]> Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/7cebc1412d8d1338a7e52cc9291d00f5368c14e4.1713781332.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christian Brauner <[email protected]>
1 parent 4575109 commit e035af9

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

fs/seq_file.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -671,14 +671,7 @@ EXPORT_SYMBOL(seq_putc);
671671

672672
void __seq_puts(struct seq_file *m, const char *s)
673673
{
674-
int len = strlen(s);
675-
676-
if (m->count + len >= m->size) {
677-
seq_set_overflow(m);
678-
return;
679-
}
680-
memcpy(m->buf + m->count, s, len);
681-
m->count += len;
674+
seq_write(m, s, strlen(s));
682675
}
683676
EXPORT_SYMBOL(__seq_puts);
684677

0 commit comments

Comments
 (0)