[PATCH 1/8] termios: Simplify rtems_termios_read_tty()
Sebastian Huber
sebastian.huber at embedded-brains.de
Thu Feb 23 14:45:33 UTC 2017
Remove dead code.
---
cpukit/libcsupport/src/termios.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c
index 5067f6c..f13e867 100644
--- a/cpukit/libcsupport/src/termios.c
+++ b/cpukit/libcsupport/src/termios.c
@@ -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++];
--
1.8.4.5
More information about the devel
mailing list