Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -773,6 +773,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)
@@ -794,17 +796,14 @@ 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;
					 buffer, size, ascii);
		seq_commit(m, ret < size ? ret : -1);

		seq_putc(m, '\n');
	}
}
}
EXPORT_SYMBOL(seq_hex_dump);

struct list_head *seq_list_start(struct list_head *head, loff_t pos)