Commit e3afc5b0 authored by Jiri Slaby (SUSE)'s avatar Jiri Slaby (SUSE) Committed by Greg Kroah-Hartman
Browse files

tty: switch size and count types in iterate_tty_read() to size_t



ld->ops->read() returns ssize_t. copy_to_iter() returns size_t. So
switch the variables ('size' and 'copied', respectively) to the
corresponding types.

This allows for use of min() in the next patch.

Signed-off-by: default avatar"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230810091510.13006-26-jirislaby@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 24b01c5d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -850,10 +850,10 @@ static ssize_t iterate_tty_read(struct tty_ldisc *ld, struct tty_struct *tty,
	unsigned long offset = 0;
	char kernel_buf[64];
	ssize_t retval = 0;
	size_t count = iov_iter_count(to);
	size_t copied, count = iov_iter_count(to);

	do {
		int size, copied;
		ssize_t size;

		size = count > sizeof(kernel_buf) ? sizeof(kernel_buf) : count;
		size = ld->ops->read(tty, file, kernel_buf, size, &cookie, offset);