linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] proc: fix smaps and meminfo alignment
@ 2018-05-24 23:00 Hugh Dickins
  0 siblings, 0 replies; only message in thread
From: Hugh Dickins @ 2018-05-24 23:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Andrei Vagin, linux-kernel, linux-mm

The 4.17-rc /proc/meminfo and /proc/<pid>/smaps look ugly: single-digit
numbers (commonly 0) are misaligned. Remove seq_put_decimal_ull_width()'s
leftover optimization for single digits: it's wrong now that num_to_str()
takes care of the width.

Fixes: d1be35cb6f96 ("proc: add seq_put_decimal_ull_width to speed up /proc/pid/smaps")
Signed-off-by: Hugh Dickins <hughd@google.com>
---

 fs/seq_file.c |    5 -----
 1 file changed, 5 deletions(-)

--- 4.17-rc6/fs/seq_file.c	2018-04-15 21:45:06.740885410 -0700
+++ linux/fs/seq_file.c	2018-05-24 14:41:21.508491794 -0700
@@ -709,11 +709,6 @@ void seq_put_decimal_ull_width(struct se
 	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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-24 23:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-24 23:00 [PATCH] proc: fix smaps and meminfo alignment Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).