OSDN Git Service

printk: ringbuffer: clear initial reserved fields
authorJohn Ogness <john.ogness@linutronix.de>
Mon, 14 Sep 2020 12:33:51 +0000 (14:39 +0206)
committerPetr Mladek <pmladek@suse.com>
Tue, 15 Sep 2020 13:47:19 +0000 (15:47 +0200)
commitcc5c7041c6e1fe8c02fe9e16f28a5e52f7a6957c
treecb181f7c18be6a1067bd3a906dd8824a64b5196d
parente3bc0401c1de2feb15601685b85b4dea45130386
printk: ringbuffer: clear initial reserved fields

prb_reserve() will set some meta data values and leave others
uninitialized (or rather, containing the values of the previous
wrap). Simplify the API by always clearing out all the fields.
Only the sequence number is filled in. The caller is now
responsible for filling in the rest of the meta data fields.
In particular, for correctly filling in text and dict lengths.

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