aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_buffer.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2013-06-15 09:36:14 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-23 16:47:09 -0700
commit47aa658a015440906def231f54685c4d5d49dc38 (patch)
tree536fc761c482c14a485b60440f3eced177c16d1d /drivers/tty/tty_buffer.c
parenttty: Use non-atomic state to signal flip buffer flush pending (diff)
downloadlinux-dev-47aa658a015440906def231f54685c4d5d49dc38.tar.xz
linux-dev-47aa658a015440906def231f54685c4d5d49dc38.zip
tty: Merge __tty_flush_buffer() into lone call site
__tty_flush_buffer() is now only called by tty_flush_buffer(); merge functions. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_buffer.c')
-rw-r--r--drivers/tty/tty_buffer.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index fb042b9a8d68..dbe4a718e2dc 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -151,28 +151,6 @@ static void tty_buffer_free(struct tty_port *port, struct tty_buffer *b)
}
/**
- * __tty_buffer_flush - flush full tty buffers
- * @tty: tty to flush
- *
- * flush all the buffers containing receive data. Caller must
- * hold the buffer lock and must have ensured no parallel flush to
- * ldisc is running.
- */
-
-static void __tty_buffer_flush(struct tty_port *port)
-{
- struct tty_bufhead *buf = &port->buf;
- struct tty_buffer *next;
-
- while ((next = buf->head->next) != NULL) {
- tty_buffer_free(port, buf->head);
- buf->head = next;
- }
- WARN_ON(buf->head != buf->tail);
- buf->head->read = buf->head->commit;
-}
-
-/**
* tty_buffer_flush - flush full tty buffers
* @tty: tty to flush
*
@@ -188,11 +166,16 @@ void tty_buffer_flush(struct tty_struct *tty)
{
struct tty_port *port = tty->port;
struct tty_bufhead *buf = &port->buf;
+ struct tty_buffer *next;
buf->flushpending = 1;
mutex_lock(&buf->flush_mutex);
- __tty_buffer_flush(port);
+ while ((next = buf->head->next) != NULL) {
+ tty_buffer_free(port, buf->head);
+ buf->head = next;
+ }
+ buf->head->read = buf->head->commit;
buf->flushpending = 0;
mutex_unlock(&buf->flush_mutex);
}