[PATCH 8/9] tty : kill receive_room usage in mxser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Note this is need checking, the logic is a bit different.

Signed-off-by: Matthieu CASTET <castet.matthieu@xxxxxxx>
---
 drivers/tty/mxser.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 8998d52..f349160 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -2056,12 +2056,9 @@ static void mxser_receive_chars(struct tty_struct *tty,
 	unsigned char ch, gdl;
 	int ignored = 0;
 	int cnt = 0;
-	int recv_room;
 	int max = 256;
+	int ret;
 
-	recv_room = tty->receive_room;
-	if (recv_room == 0 && !port->ldisc_stop_rx)
-		mxser_stoprx(tty);
 	if (port->board->chip_flag != MOXA_OTHER_UART) {
 
 		if (*status & UART_LSR_SPECIAL)
@@ -2076,13 +2073,13 @@ static void mxser_receive_chars(struct tty_struct *tty,
 
 		if (port->board->chip_flag == MOXA_MUST_MU150_HWID)
 			gdl &= MOXA_MUST_GDL_MASK;
-		if (gdl >= recv_room) {
-			if (!port->ldisc_stop_rx)
-				mxser_stoprx(tty);
-		}
 		while (gdl--) {
 			ch = inb(port->ioaddr + UART_RX);
-			tty_insert_flip_char(tty, ch, 0);
+			ret = tty_insert_flip_char(tty, ch, 0);
+			if (ret != 1) {
+				if (!port->ldisc_stop_rx)
+					mxser_stoprx(tty);
+			}
 			cnt++;
 		}
 		goto end_intr;
@@ -2121,9 +2118,9 @@ intr_old:
 				} else
 					flag = TTY_BREAK;
 			}
-			tty_insert_flip_char(tty, ch, flag);
+			ret = tty_insert_flip_char(tty, ch, flag);
 			cnt++;
-			if (cnt >= recv_room) {
+			if (ret != 1) {
 				if (!port->ldisc_stop_rx)
 					mxser_stoprx(tty);
 				break;
-- 
1.7.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux