mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 23:41:54 +08:00
termios: Simplify rtems_termios_read_tty()
Remove dead code. Update #2914.
This commit is contained in:
@@ -1369,7 +1369,7 @@ siproc (unsigned char c, struct rtems_termios_tty *tty)
|
||||
/*
|
||||
* Fill the input buffer by polling the device
|
||||
*/
|
||||
static rtems_status_code
|
||||
static void
|
||||
fillBufferPoll (struct rtems_termios_tty *tty)
|
||||
{
|
||||
int n;
|
||||
@@ -1416,13 +1416,12 @@ fillBufferPoll (struct rtems_termios_tty *tty)
|
||||
}
|
||||
}
|
||||
}
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fill the input buffer from the raw input queue
|
||||
*/
|
||||
static rtems_status_code
|
||||
static void
|
||||
fillBufferQueue (struct rtems_termios_tty *tty)
|
||||
{
|
||||
rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout;
|
||||
@@ -1484,7 +1483,6 @@ fillBufferQueue (struct rtems_termios_tty *tty)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
@@ -1496,17 +1494,12 @@ rtems_termios_read_tty (struct rtems_termios_tty *tty, char *buffer,
|
||||
count = initial_count;
|
||||
|
||||
if (tty->cindex == tty->ccount) {
|
||||
rtems_status_code sc;
|
||||
|
||||
tty->cindex = tty->ccount = 0;
|
||||
tty->read_start_column = tty->column;
|
||||
if (tty->handler.poll_read != NULL && tty->handler.mode == TERMIOS_POLLED)
|
||||
sc = fillBufferPoll (tty);
|
||||
fillBufferPoll (tty);
|
||||
else
|
||||
sc = fillBufferQueue (tty);
|
||||
|
||||
if (sc != RTEMS_SUCCESSFUL)
|
||||
tty->cindex = tty->ccount = 0;
|
||||
fillBufferQueue (tty);
|
||||
}
|
||||
while (count && (tty->cindex < tty->ccount)) {
|
||||
*buffer++ = tty->cbuf[tty->cindex++];
|
||||
|
||||
Reference in New Issue
Block a user