Skip to content

Commit

Permalink
seq_file: Simplify __seq_puts()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christophe JAILLET authored and Christian Brauner committed May 2, 2024
1 parent 4575109 commit e035af9
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions fs/seq_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e035af9

Please sign in to comment.