printk: refactor kmsg_dump_get_buffer()
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 3 Mar 2021 10:15:18 +0000 (11:15 +0100)
committerPetr Mladek <pmladek@suse.com>
Mon, 8 Mar 2021 10:43:05 +0000 (11:43 +0100)
commit726b5097701a8d46f5354be780e1a11fc4ca1187
tree161c5ccbd684c5de992742078b81c68d117aa172
parente831e400f73b0e7aa4629200c2ef71e068262414
printk: refactor kmsg_dump_get_buffer()

kmsg_dump_get_buffer() requires nearly the same logic as
syslog_print_all(), but uses different variable names and
does not make use of the ringbuffer loop macros. Modify
kmsg_dump_get_buffer() so that the implementation is as similar
to syslog_print_all() as possible.

A follow-up commit will move this common logic into a
separate helper function.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210303101528.29901-6-john.ogness@linutronix.de
include/linux/kmsg_dump.h
kernel/printk/printk.c