Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230810091510.13006-26-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
e3afc5b0 24b01c5d

+2 -2
+2 -2
drivers/tty/tty_io.c
··· 850 850 unsigned long offset = 0; 851 851 char kernel_buf[64]; 852 852 ssize_t retval = 0; 853 - size_t count = iov_iter_count(to); 853 + size_t copied, count = iov_iter_count(to); 854 854 855 855 do { 856 - int size, copied; 856 + ssize_t size; 857 857 858 858 size = count > sizeof(kernel_buf) ? sizeof(kernel_buf) : count; 859 859 size = ld->ops->read(tty, file, kernel_buf, size, &cookie, offset);