summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-09-23 09:04:37 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2015-09-23 09:04:37 +1000
commit1a65caff945d38ce5af078e0006c07276534f9b5 (patch)
treedc6e8cfe47a2a2ff5dd7f68c51f41174616201ab
parentc31c79ad77c0ef134e3b2822ceec445bc8e1b567 (diff)
downloadlinux-1a65caff945d38ce5af078e0006c07276534f9b5.tar.gz
linux-1a65caff945d38ce5af078e0006c07276534f9b5.tar.xz
fs/seq_file: use seq_* helpers in seq_hex_dump()
This improves code readability. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--fs/seq_file.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 0f9ab58632bb..00bbe2bfc634 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -760,6 +760,8 @@ void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type,
{
const u8 *ptr = buf;
int i, linelen, remaining = len;
+ char *buffer;
+ size_t size;
int ret;
if (rowsize != 16 && rowsize != 32)
@@ -781,15 +783,12 @@ void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type,
break;
}
+ size = seq_get_buf(m, &buffer);
ret = hex_dump_to_buffer(ptr + i, linelen, rowsize, groupsize,
- m->buf + m->count, m->size - m->count,
- ascii);
- if (ret >= m->size - m->count) {
- seq_set_overflow(m);
- } else {
- m->count += ret;
- seq_putc(m, '\n');
- }
+ buffer, size, ascii);
+ seq_commit(m, ret < size ? ret : -1);
+
+ seq_putc(m, '\n');
}
}
EXPORT_SYMBOL(seq_hex_dump);