aboutsummaryrefslogtreecommitdiff
path: root/include/linux/console.h
diff options
context:
space:
mode:
authorJiri Slaby (SUSE) <jirislaby@kernel.org>2024-01-22 12:03:39 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-27 18:08:54 -0800
commit338c28107b51083846afdc5fe8f7830cc8abd893 (patch)
treedd27c3420428b568a56e154efc8450d0de8e1022 /include/linux/console.h
parent8bc03a30093024c68f10fb9033ca28f925074c52 (diff)
tty: vt: sanitize consw::con_putc() parameters
Make parameters of consw::con_putc() saner: * x and y are unsigned now, as they cannot be negative, and * ca is made u16, as it is composed of two 8bit values (character and attribute). See the con_putcs() hook, u16/ushort is worked on there. And document the hook. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Cc: Helge Deller <deller@gmx.de> Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Tested-by: Helge Deller <deller@gmx.de> # parisc STI console Link: https://lore.kernel.org/r/20240122110401.7289-26-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/console.h')
-rw-r--r--include/linux/console.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/console.h b/include/linux/console.h
index 8fd96a5fca5f..92d57e5b3009 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -39,6 +39,8 @@ enum vc_intensity;
* @con_init: initialize the console on @vc. @init is true for the very first
* call on this @vc.
* @con_clear: erase @count characters at [@x, @y] on @vc. @count >= 1.
+ * @con_putc: emit one character with attributes @ca to [@x, @y] on @vc.
+ * (optional -- @con_putcs would be called instead)
* @con_scroll: move lines from @top to @bottom in direction @dir by @lines.
* Return true if no generic handling should be done.
* Invoked by csi_M and printing to the console.
@@ -53,7 +55,8 @@ struct consw {
void (*con_deinit)(struct vc_data *vc);
void (*con_clear)(struct vc_data *vc, unsigned int y,
unsigned int x, unsigned int count);
- void (*con_putc)(struct vc_data *vc, int c, int ypos, int xpos);
+ void (*con_putc)(struct vc_data *vc, u16 ca, unsigned int y,
+ unsigned int x);
void (*con_putcs)(struct vc_data *vc, const unsigned short *s,
int count, int ypos, int xpos);
void (*con_cursor)(struct vc_data *vc, int mode);