diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2016-01-10 20:36:13 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-01-28 14:13:44 -0800 |
commit | 8d082cd300ab422b7ee9f4629a1c470e4f0d90d5 (patch) | |
tree | e44228e8282f9689cfff223d17262d19525ad9ef /include/linux/tty.h | |
parent | f33798deecbd59a2955f40ac0ae2bc7dff54c069 (diff) | |
download | linux-8d082cd300ab422b7ee9f4629a1c470e4f0d90d5.tar.gz linux-8d082cd300ab422b7ee9f4629a1c470e4f0d90d5.tar.bz2 linux-8d082cd300ab422b7ee9f4629a1c470e4f0d90d5.zip |
tty: Unify receive_buf() code paths
Instead of two distinct code branches for receive_buf() handling,
use tty_ldisc_receive_buf() as the single code path.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r-- | include/linux/tty.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 03e4015fa033..3b09f235db66 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -571,20 +571,8 @@ extern int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty); extern void tty_ldisc_release(struct tty_struct *tty); extern void tty_ldisc_init(struct tty_struct *tty); extern void tty_ldisc_deinit(struct tty_struct *tty); - -static inline int tty_ldisc_receive_buf(struct tty_ldisc *ld, unsigned char *p, - char *f, int count) -{ - if (ld->ops->receive_buf2) - count = ld->ops->receive_buf2(ld->tty, p, f, count); - else { - count = min_t(int, count, ld->tty->receive_room); - if (count && ld->ops->receive_buf) - ld->ops->receive_buf(ld->tty, p, f, count); - } - return count; -} - +extern int tty_ldisc_receive_buf(struct tty_ldisc *ld, unsigned char *p, + char *f, int count); /* n_tty.c */ extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops); |