aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/tty_flip.h
diff options
context:
space:
mode:
authorJiri Slaby (SUSE) <jirislaby@kernel.org>2023-08-16 12:55:26 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-22 14:58:15 +0200
commit2ce2983c24c11beaeb6ef6da93bf7228679bd08b (patch)
tree19ac746b96621130e6ba27afbafe17cbdc46fc2a /include/linux/tty_flip.h
parenttty: tty_buffer: switch insert functions to size_t (diff)
downloadwireguard-linux-2ce2983c24c11beaeb6ef6da93bf7228679bd08b.tar.xz
wireguard-linux-2ce2983c24c11beaeb6ef6da93bf7228679bd08b.zip
tty: tty_buffer: let tty_prepare_flip_string() return size_t
The same as in the previous patch, tty_prepare_flip_string() accepts size_t as an size argument. It returns the same size (or less). It is unexpected that it returns a signed value and can confuse users to check for negative values. Instead, return the same size_t as accepted to make clear we return values >= 0, where zero in fact means failure. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20230816105530.3335-7-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty_flip.h')
-rw-r--r--include/linux/tty_flip.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index 569747364ae5..efd03d9c11f8 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -13,7 +13,7 @@ int tty_buffer_request_room(struct tty_port *port, size_t size);
size_t __tty_insert_flip_string_flags(struct tty_port *port, const u8 *chars,
const u8 *flags, bool mutable_flags,
size_t size);
-int tty_prepare_flip_string(struct tty_port *port, u8 **chars, size_t size);
+size_t tty_prepare_flip_string(struct tty_port *port, u8 **chars, size_t size);
void tty_flip_buffer_push(struct tty_port *port);
int __tty_insert_flip_char(struct tty_port *port, u8 ch, u8 flag);