mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
tty: hvc: convert counts to size_t
Unify the type of tty_operations::write() counters with the 'count' parameter. I.e. use size_t for them. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230810091510.13006-33-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
49b8220cee
commit
8428e5223e
@ -500,7 +500,7 @@ static ssize_t hvc_write(struct tty_struct *tty, const u8 *buf, size_t count)
|
||||
{
|
||||
struct hvc_struct *hp = tty->driver_data;
|
||||
unsigned long flags;
|
||||
int rsize, written = 0;
|
||||
size_t rsize, written = 0;
|
||||
|
||||
/* This write was probably executed during a tty close. */
|
||||
if (!hp)
|
||||
|
@ -1263,8 +1263,8 @@ static ssize_t hvcs_write(struct tty_struct *tty, const u8 *buf, size_t count)
|
||||
unsigned int unit_address;
|
||||
const unsigned char *charbuf;
|
||||
unsigned long flags;
|
||||
int total_sent = 0;
|
||||
int tosend = 0;
|
||||
size_t total_sent = 0;
|
||||
size_t tosend = 0;
|
||||
int result = 0;
|
||||
|
||||
/*
|
||||
@ -1299,7 +1299,7 @@ static ssize_t hvcs_write(struct tty_struct *tty, const u8 *buf, size_t count)
|
||||
unit_address = hvcsd->vdev->unit_address;
|
||||
|
||||
while (count > 0) {
|
||||
tosend = min_t(unsigned, count,
|
||||
tosend = min_t(size_t, count,
|
||||
(HVCS_BUFF_LEN - hvcsd->chars_in_buffer));
|
||||
/*
|
||||
* No more space, this probably means that the last call to
|
||||
|
@ -909,8 +909,8 @@ static ssize_t hvsi_write(struct tty_struct *tty, const u8 *source,
|
||||
{
|
||||
struct hvsi_struct *hp = tty->driver_data;
|
||||
unsigned long flags;
|
||||
int total = 0;
|
||||
int origcount = count;
|
||||
size_t total = 0;
|
||||
size_t origcount = count;
|
||||
|
||||
spin_lock_irqsave(&hp->lock, flags);
|
||||
|
||||
@ -928,7 +928,7 @@ static ssize_t hvsi_write(struct tty_struct *tty, const u8 *source,
|
||||
* will see there is no room in outbuf and return.
|
||||
*/
|
||||
while ((count > 0) && (hvsi_write_room(tty) > 0)) {
|
||||
int chunksize = min_t(int, count, hvsi_write_room(tty));
|
||||
size_t chunksize = min_t(size_t, count, hvsi_write_room(tty));
|
||||
|
||||
BUG_ON(hp->n_outbuf < 0);
|
||||
memcpy(hp->outbuf + hp->n_outbuf, source, chunksize);
|
||||
@ -952,8 +952,8 @@ out:
|
||||
spin_unlock_irqrestore(&hp->lock, flags);
|
||||
|
||||
if (total != origcount)
|
||||
pr_debug("%s: wanted %i, only wrote %i\n", __func__, origcount,
|
||||
total);
|
||||
pr_debug("%s: wanted %zu, only wrote %zu\n", __func__,
|
||||
origcount, total);
|
||||
|
||||
return total;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user