diff options
author | Jiri Slaby (SUSE) <jirislaby@kernel.org> | 2023-08-10 12:15:03 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-11 22:12:46 +0300 |
commit | 95713967ba52389f7cea75704d0cf048080ec218 (patch) | |
tree | fec0df386db066c0026c8eb2e7fef035903e9af0 /drivers/tty/mips_ejtag_fdc.c | |
parent | dcaafbe6ee3b39f2df11a1352f85172f8ade17a5 (diff) | |
download | linux-95713967ba52389f7cea75704d0cf048080ec218.tar.xz |
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/mips_ejtag_fdc.c')
-rw-r--r-- | drivers/tty/mips_ejtag_fdc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/tty/mips_ejtag_fdc.c b/drivers/tty/mips_ejtag_fdc.c index cf4ef0c38624..369ec71c24ef 100644 --- a/drivers/tty/mips_ejtag_fdc.c +++ b/drivers/tty/mips_ejtag_fdc.c @@ -796,8 +796,8 @@ static void mips_ejtag_fdc_tty_hangup(struct tty_struct *tty) tty_port_hangup(tty->port); } -static int mips_ejtag_fdc_tty_write(struct tty_struct *tty, const u8 *buf, - int total) +static ssize_t mips_ejtag_fdc_tty_write(struct tty_struct *tty, const u8 *buf, + size_t total) { int count, block; struct mips_ejtag_fdc_tty_port *dport = tty->driver_data; @@ -816,7 +816,7 @@ static int mips_ejtag_fdc_tty_write(struct tty_struct *tty, const u8 *buf, */ spin_lock(&dport->xmit_lock); /* Work out how many bytes we can write to the xmit buffer */ - total = min(total, (int)(priv->xmit_size - dport->xmit_cnt)); + total = min_t(size_t, total, priv->xmit_size - dport->xmit_cnt); atomic_add(total, &priv->xmit_total); dport->xmit_cnt += total; /* Write the actual bytes (may need splitting if it wraps) */ |