OSDN Git Service

printk: consolidate kmsg_dump_get_buffer/syslog_print_all code
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 3 Mar 2021 10:15:19 +0000 (11:15 +0100)
committerPetr Mladek <pmladek@suse.com>
Mon, 8 Mar 2021 10:43:09 +0000 (11:43 +0100)
commit4260e0e5510158d704898603331e5365ebe957de
tree41aeee1ceed4a13329ff602ef230d68a9b643b8c
parent726b5097701a8d46f5354be780e1a11fc4ca1187
printk: consolidate kmsg_dump_get_buffer/syslog_print_all code

The logic for finding records to fit into a buffer is the same for
kmsg_dump_get_buffer() and syslog_print_all(). Introduce a helper
function find_first_fitting_seq() to handle this logic.

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-7-john.ogness@linutronix.de
kernel/printk/printk.c