Commit 8b91a318 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Torvalds

fs/seq_file: use seq_* helpers in seq_hex_dump()

This improves code readability.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d61ba589
...@@ -773,6 +773,8 @@ void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type, ...@@ -773,6 +773,8 @@ void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type,
{ {
const u8 *ptr = buf; const u8 *ptr = buf;
int i, linelen, remaining = len; int i, linelen, remaining = len;
char *buffer;
size_t size;
int ret; int ret;
if (rowsize != 16 && rowsize != 32) if (rowsize != 16 && rowsize != 32)
...@@ -794,16 +796,13 @@ void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type, ...@@ -794,16 +796,13 @@ void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type,
break; break;
} }
size = seq_get_buf(m, &buffer);
ret = hex_dump_to_buffer(ptr + i, linelen, rowsize, groupsize, ret = hex_dump_to_buffer(ptr + i, linelen, rowsize, groupsize,
m->buf + m->count, m->size - m->count, buffer, size, ascii);
ascii); seq_commit(m, ret < size ? ret : -1);
if (ret >= m->size - m->count) {
seq_set_overflow(m);
} else {
m->count += ret;
seq_putc(m, '\n'); seq_putc(m, '\n');
} }
}
} }
EXPORT_SYMBOL(seq_hex_dump); EXPORT_SYMBOL(seq_hex_dump);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment