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 receive_buf() counts to size_t

'size_t' is what receive_buf() expects and returns while handling count.
So switch to 'size_t'.

This renders both local 'count' and 'rcvd' in flush_to_ldisc() to be
size_t too.

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

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
201560af 0468a807

+4 -4
+4 -4
drivers/tty/tty_buffer.c
··· 502 502 } 503 503 } 504 504 505 - static int 506 - receive_buf(struct tty_port *port, struct tty_buffer *head, int count) 505 + static size_t 506 + receive_buf(struct tty_port *port, struct tty_buffer *head, size_t count) 507 507 { 508 508 u8 *p = char_buf_ptr(head, head->read); 509 509 const u8 *f = NULL; 510 - int n; 510 + size_t n; 511 511 512 512 if (head->flags) 513 513 f = flag_buf_ptr(head, head->read); ··· 539 539 while (1) { 540 540 struct tty_buffer *head = buf->head; 541 541 struct tty_buffer *next; 542 - int count, rcvd; 542 + size_t count, rcvd; 543 543 544 544 /* Ldisc or user is trying to gain exclusive access */ 545 545 if (atomic_read(&buf->priority))