tty: tty_buffer: let tty_prepare_flip_string() return size_t
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Wed, 16 Aug 2023 10:55:26 +0000 (12:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Aug 2023 12:58:15 +0000 (14:58 +0200)
commit2ce2983c24c11beaeb6ef6da93bf7228679bd08b
tree19ac746b96621130e6ba27afbafe17cbdc46fc2a
parent6144922e17677204cbead4ee544699af69785a84
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>
drivers/tty/tty_buffer.c
include/linux/tty_flip.h