[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240210215147.77629-13-michael.zaidman@gmail.com>
Date: Sat, 10 Feb 2024 23:51:40 +0200
From: Michael Zaidman <michael.zaidman@...il.com>
To: chrysh@...istina-quast.de,
daniel.beer@...rinstitute.com,
jikos@...nel.org
Cc: linux-kernel@...r.kernel.org,
linux-input@...r.kernel.org,
linux-serial@...r.kernel.org,
ilpo.jarvinen@...ux.intel.com,
johan@...nel.org,
gregkh@...uxfoundation.org,
equinox@...c24.net,
michael.zaidman@...il.com
Subject: [PATCH v1 12/19] hid-ft260: uart: use kfifo_avail for fifo write room check
Replace uart fifo write room calculation with the kfifo_avail kernel API.
Signed-off-by: Michael Zaidman <michael.zaidman@...il.com>
---
drivers/hid/hid-ft260.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c
index f8d4bf7e6c4f..3d1a9ec88cb9 100644
--- a/drivers/hid/hid-ft260.c
+++ b/drivers/hid/hid-ft260.c
@@ -1264,7 +1264,7 @@ static unsigned int ft260_uart_write_room(struct tty_struct *tty)
{
struct ft260_device *port = tty->driver_data;
- return FIFO_SIZE - kfifo_len(&port->xmit_fifo);
+ return kfifo_avail(&port->xmit_fifo);
}
static unsigned int ft260_uart_chars_in_buffer(struct tty_struct *tty)
--
2.40.1
Powered by blists - more mailing lists