aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/n_tty.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2014-02-11 18:55:30 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-13 13:18:48 -0500
commit25e8d0ed75a6b3e7c2f533f0460a48f903d94269 (patch)
tree6d3d05d765375eba4432037e1f453d435a622b4d /drivers/tty/n_tty.c
parent5669b705024659e982472cef22f7fc3c3a09cba2 (diff)
n_tty: Simplify input_available_p()
Greg, Please note this patch requires n_tty: Fix poll() when TIME_CHAR and MIN_CHAR == 0 Regards, Peter Hurley Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r--drivers/tty/n_tty.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index d15624c1b751..41fe8a047d37 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -1900,13 +1900,10 @@ static inline int input_available_p(struct tty_struct *tty, int poll)
1900 struct n_tty_data *ldata = tty->disc_data; 1900 struct n_tty_data *ldata = tty->disc_data;
1901 int amt = poll && !TIME_CHAR(tty) && MIN_CHAR(tty) ? MIN_CHAR(tty) : 1; 1901 int amt = poll && !TIME_CHAR(tty) && MIN_CHAR(tty) ? MIN_CHAR(tty) : 1;
1902 1902
1903 if (ldata->icanon && !L_EXTPROC(tty)) { 1903 if (ldata->icanon && !L_EXTPROC(tty))
1904 if (ldata->canon_head != ldata->read_tail) 1904 return ldata->canon_head != ldata->read_tail;
1905 return 1; 1905 else
1906 } else if (read_cnt(ldata) >= amt) 1906 return read_cnt(ldata) >= amt;
1907 return 1;
1908
1909 return 0;
1910} 1907}
1911 1908
1912/** 1909/**