From f8384a0b5044d638c8f36dc3d82ac9d6710ad9f6 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan <adobriyan@gmail.com> Date: Mon, 23 Apr 2018 08:20:33 +1000 Subject: [PATCH] fs/seq_file.c: delete small-value optimization num_to_str() optimizes printing small integers [0..9], so the same check higher in callchain is unnecessary. Link: http://lkml.kernel.org/r/20170516204246.GA18123@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> --- fs/seq_file.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/fs/seq_file.c b/fs/seq_file.c index c6c27f1f9c98..8389da9d0eb8 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -709,11 +709,6 @@ void seq_put_decimal_ull_width(struct seq_file *m, const char *delimiter, if (m->count + width >= m->size) goto overflow; - if (num < 10) { - m->buf[m->count++] = num + '0'; - return; - } - len = num_to_str(m->buf + m->count, m->size - m->count, num, width); if (!len) goto overflow; @@ -800,11 +795,6 @@ void seq_put_decimal_ll(struct seq_file *m, const char *delimiter, long long num num = -num; } - if (num < 10) { - m->buf[m->count++] = num + '0'; - return; - } - len = num_to_str(m->buf + m->count, m->size - m->count, num, 0); if (!len) goto overflow; -- GitLab