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>
}
}
+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
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