From 95713967ba52389f7cea75704d0cf048080ec218 Mon Sep 17 00:00:00 2001 From: "Jiri Slaby (SUSE)" Date: Thu, 10 Aug 2023 11:15:03 +0200 Subject: tty: make tty_operations::write()'s count size_t Unify with the rest of the code. Use size_t for counts and ssize_t for retval. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230810091510.13006-30-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/tty/vcc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/tty/vcc.c') diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c index c223879039b8..9cc569174c83 100644 --- a/drivers/tty/vcc.c +++ b/drivers/tty/vcc.c @@ -804,7 +804,7 @@ static void vcc_hangup(struct tty_struct *tty) tty_port_hangup(tty->port); } -static int vcc_write(struct tty_struct *tty, const u8 *buf, int count) +static ssize_t vcc_write(struct tty_struct *tty, const u8 *buf, size_t count) { struct vcc_port *port; struct vio_vcc *pkt; @@ -826,7 +826,8 @@ static int vcc_write(struct tty_struct *tty, const u8 *buf, int count) while (count > 0) { /* Minimum of data to write and space available */ - tosend = min(count, (VCC_BUFF_LEN - port->chars_in_buffer)); + tosend = min_t(size_t, count, + (VCC_BUFF_LEN - port->chars_in_buffer)); if (!tosend) break; -- cgit v1.2.3