mirror of
https://github.com/torvalds/linux.git
synced 2024-12-03 09:31:26 +00:00
tty: make tty_buffer_space_avail return uint
tty_buffer_space_avail returns values >= 0, so make it clear by the return type. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Joel Stanley <joel@jms.id.au> Link: https://lore.kernel.org/r/20210505091928.22010-25-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
03b3b1a240
commit
9a33fbf9d2
@ -329,7 +329,7 @@ static int aspeed_vuart_handle_irq(struct uart_port *port)
|
|||||||
{
|
{
|
||||||
struct uart_8250_port *up = up_to_u8250p(port);
|
struct uart_8250_port *up = up_to_u8250p(port);
|
||||||
unsigned int iir, lsr;
|
unsigned int iir, lsr;
|
||||||
int space, count;
|
unsigned int space, count;
|
||||||
|
|
||||||
iir = serial_port_in(port, UART_IIR);
|
iir = serial_port_in(port, UART_IIR);
|
||||||
|
|
||||||
@ -353,7 +353,7 @@ static int aspeed_vuart_handle_irq(struct uart_port *port)
|
|||||||
jiffies + unthrottle_timeout);
|
jiffies + unthrottle_timeout);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
count = min(space, 256);
|
count = min(space, 256U);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
serial8250_read_char(up, lsr);
|
serial8250_read_char(up, lsr);
|
||||||
|
@ -88,7 +88,7 @@ EXPORT_SYMBOL_GPL(tty_buffer_unlock_exclusive);
|
|||||||
* pre-allocate if memory guarantee is required).
|
* pre-allocate if memory guarantee is required).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int tty_buffer_space_avail(struct tty_port *port)
|
unsigned int tty_buffer_space_avail(struct tty_port *port)
|
||||||
{
|
{
|
||||||
int space = port->buf.mem_limit - atomic_read(&port->buf.mem_used);
|
int space = port->buf.mem_limit - atomic_read(&port->buf.mem_used);
|
||||||
return max(space, 0);
|
return max(space, 0);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#define _LINUX_TTY_FLIP_H
|
#define _LINUX_TTY_FLIP_H
|
||||||
|
|
||||||
extern int tty_buffer_set_limit(struct tty_port *port, int limit);
|
extern int tty_buffer_set_limit(struct tty_port *port, int limit);
|
||||||
extern int tty_buffer_space_avail(struct tty_port *port);
|
extern unsigned int tty_buffer_space_avail(struct tty_port *port);
|
||||||
extern int tty_buffer_request_room(struct tty_port *port, size_t size);
|
extern int tty_buffer_request_room(struct tty_port *port, size_t size);
|
||||||
extern int tty_insert_flip_string_flags(struct tty_port *port,
|
extern int tty_insert_flip_string_flags(struct tty_port *port,
|
||||||
const unsigned char *chars, const char *flags, size_t size);
|
const unsigned char *chars, const char *flags, size_t size);
|
||||||
|
Loading…
Reference in New Issue
Block a user