Skip to content
Snippets Groups Projects
Commit f8384a0b authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Stephen Rothwell
Browse files

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: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
parent df8e9234
No related branches found
No related tags found
No related merge requests found
...@@ -709,11 +709,6 @@ void seq_put_decimal_ull_width(struct seq_file *m, const char *delimiter, ...@@ -709,11 +709,6 @@ void seq_put_decimal_ull_width(struct seq_file *m, const char *delimiter,
if (m->count + width >= m->size) if (m->count + width >= m->size)
goto overflow; 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); len = num_to_str(m->buf + m->count, m->size - m->count, num, width);
if (!len) if (!len)
goto overflow; goto overflow;
...@@ -800,11 +795,6 @@ void seq_put_decimal_ll(struct seq_file *m, const char *delimiter, long long num ...@@ -800,11 +795,6 @@ void seq_put_decimal_ll(struct seq_file *m, const char *delimiter, long long num
num = -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); len = num_to_str(m->buf + m->count, m->size - m->count, num, 0);
if (!len) if (!len)
goto overflow; goto overflow;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment