diff options
author | Jiri Slaby (SUSE) <jirislaby@kernel.org> | 2023-08-16 12:55:27 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-22 14:58:15 +0200 |
commit | b49a0ff7328f5f9acfd027906f4c7d313a225361 (patch) | |
tree | 552ed3638beefe0a87919afc43be96e3a6273b51 /drivers/tty | |
parent | 2ce2983c24c11beaeb6ef6da93bf7228679bd08b (diff) |
tty: tty_buffer: use __tty_insert_flip_string_flags() in tty_insert_flip_char()
Use __tty_insert_flip_string_flags() for the slow path of
tty_insert_flip_char(). The former is generic enough, so there is no
reason to reimplement the injection once again.
So now we have a single function stuffing into tty buffers.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230816105530.3335-8-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/tty_buffer.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 4f84466498f7..e162318d6c31 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -344,32 +344,6 @@ size_t __tty_insert_flip_string_flags(struct tty_port *port, const u8 *chars, EXPORT_SYMBOL(__tty_insert_flip_string_flags); /** - * __tty_insert_flip_char - add one character to the tty buffer - * @port: tty port - * @ch: character - * @flag: flag byte - * - * Queue a single byte @ch to the tty buffering, with an optional flag. This is - * the slow path of tty_insert_flip_char(). - */ -int __tty_insert_flip_char(struct tty_port *port, u8 ch, u8 flag) -{ - struct tty_buffer *tb; - bool flags = flag != TTY_NORMAL; - - if (!__tty_buffer_request_room(port, 1, flags)) - return 0; - - tb = port->buf.tail; - if (tb->flags) - *flag_buf_ptr(tb, tb->used) = flag; - *char_buf_ptr(tb, tb->used++) = ch; - - return 1; -} -EXPORT_SYMBOL(__tty_insert_flip_char); - -/** * tty_prepare_flip_string - make room for characters * @port: tty port * @chars: return pointer for character write area |