aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/n_tty.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2015-01-16 15:05:36 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-02 13:11:26 -0500
commit5e28cca1539f3532cb2392710655cd3e562cee8b (patch)
treed37777b70cbdb5483cc413b84d52d43a92eef7a7 /drivers/tty/n_tty.c
parenta342846f9b0448996f56ebece80454d41b431ce2 (diff)
n_tty: Simplify throttle threshold calculation
The adjustments performed by receive_room() are to ensure a line termination can always be written to the read buffer. However, these adjustments are irrelevant to the throttle threshold (because the threshold < buffer limit). Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r--drivers/tty/n_tty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index d4b14c30794e..7efabc4673b6 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -262,7 +262,7 @@ static void n_tty_check_throttle(struct tty_struct *tty)
262 while (1) { 262 while (1) {
263 int throttled; 263 int throttled;
264 tty_set_flow_change(tty, TTY_THROTTLE_SAFE); 264 tty_set_flow_change(tty, TTY_THROTTLE_SAFE);
265 if (receive_room(tty) >= TTY_THRESHOLD_THROTTLE) 265 if (N_TTY_BUF_SIZE - read_cnt(ldata) >= TTY_THRESHOLD_THROTTLE)
266 break; 266 break;
267 throttled = tty_throttle_safe(tty); 267 throttled = tty_throttle_safe(tty);
268 if (!throttled) 268 if (!throttled)