diff options
author | Jiri Slaby (SUSE) <jirislaby@kernel.org> | 2023-08-10 11:15:03 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-11 21:12:46 +0200 |
commit | 95713967ba52389f7cea75704d0cf048080ec218 (patch) | |
tree | fec0df386db066c0026c8eb2e7fef035903e9af0 /drivers/tty/rpmsg_tty.c | |
parent | dcaafbe6ee3b39f2df11a1352f85172f8ade17a5 (diff) |
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)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230810091510.13006-30-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/rpmsg_tty.c')
-rw-r--r-- | drivers/tty/rpmsg_tty.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/rpmsg_tty.c b/drivers/tty/rpmsg_tty.c index 29db413bbc03..60a2915f5cfe 100644 --- a/drivers/tty/rpmsg_tty.c +++ b/drivers/tty/rpmsg_tty.c @@ -73,7 +73,8 @@ static void rpmsg_tty_close(struct tty_struct *tty, struct file *filp) return tty_port_close(tty->port, tty, filp); } -static int rpmsg_tty_write(struct tty_struct *tty, const u8 *buf, int len) +static ssize_t rpmsg_tty_write(struct tty_struct *tty, const u8 *buf, + size_t len) { struct rpmsg_tty_port *cport = tty->driver_data; struct rpmsg_device *rpdev; @@ -86,7 +87,7 @@ static int rpmsg_tty_write(struct tty_struct *tty, const u8 *buf, int len) if (msg_max_size < 0) return msg_max_size; - msg_size = min(len, msg_max_size); + msg_size = min_t(unsigned int, len, msg_max_size); /* * Use rpmsg_trysend instead of rpmsg_send to send the message so the caller is not |