n_tty: Move chars_in_buffer() to factor throttle/unthrottle
authorPeter Hurley <peter@hurleysoftware.com>
Sat, 15 Jun 2013 13:14:32 +0000 (09:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 23:43:02 +0000 (16:43 -0700)
Prepare to factor throttle and unthrottle into helper functions;
relocate chars_in_buffer() to avoid forward declaration.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c

index b78ee464bd09ac431d5484ddaa1efca8c62aaeee..9ec0c68aa7396c4a46be620ffadbc5f27b1b998a 100644 (file)
@@ -202,6 +202,18 @@ static void n_tty_set_room(struct tty_struct *tty)
        }
 }
 
+static ssize_t chars_in_buffer(struct tty_struct *tty)
+{
+       struct n_tty_data *ldata = tty->disc_data;
+       ssize_t n = 0;
+
+       if (!ldata->icanon)
+               n = read_cnt(ldata);
+       else
+               n = ldata->canon_head - ldata->read_tail;
+       return n;
+}
+
 /**
  *     put_tty_queue           -       add character to tty
  *     @c: character
@@ -285,18 +297,6 @@ static void n_tty_flush_buffer(struct tty_struct *tty)
        up_write(&tty->termios_rwsem);
 }
 
-static ssize_t chars_in_buffer(struct tty_struct *tty)
-{
-       struct n_tty_data *ldata = tty->disc_data;
-       ssize_t n = 0;
-
-       if (!ldata->icanon)
-               n = read_cnt(ldata);
-       else
-               n = ldata->canon_head - ldata->read_tail;
-       return n;
-}
-
 /**
  *     n_tty_chars_in_buffer   -       report available bytes
  *     @tty: tty device