[PATCH printk 15/18] printk: Add struct cons_text_buf

From: John Ogness
Date: Fri Sep 23 2022 - 20:06:20 EST


From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

Create a data structure to replace the open coded separate buffers for
regular and extended formatting.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Signed-off-by: John Ogness <john.ogness@xxxxxxxxxxxxx>
---
include/linux/console.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/include/linux/console.h b/include/linux/console.h
index 8ec24fe097d3..05c7325e98f9 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -173,6 +173,20 @@ enum cons_flags {
CON_EXTENDED = BIT(6),
};

+/**
+ * struct cons_text_buf - console output text buffer
+ * @ext_text: Buffer for extended log format text
+ * @dropped_text: Buffer for dropped text
+ * @text: Buffer for ringbuffer text
+ */
+struct cons_text_buf {
+ union {
+ char ext_text[CONSOLE_EXT_LOG_MAX];
+ char dropped_text[DROPPED_TEXT_MAX];
+ };
+ char text[CONSOLE_LOG_MAX];
+};
+
/**
* struct console - The console descriptor structure
* @name: The name of the console driver
--
2.30.2