tty: Remove chars_in_buffer() line discipline method
The chars_in_buffer() line discipline method serves no functional purpose, other than as a (dubious) debugging aid for mostly bit-rotting drivers. Despite being documented as an optional method, every caller is unconditionally executed (although conditionally compiled). Furthermore, direct tty->ldisc access without an ldisc ref is unsafe. Lastly, N_TTY's chars_in_buffer() has warned of removal since 3.12. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
582e20a03b
commit
fdfb719e93
@@ -2303,21 +2303,6 @@ static void gsmld_receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
||||
/* If clogged call tty_throttle(tty); */
|
||||
}
|
||||
|
||||
/**
|
||||
* gsmld_chars_in_buffer - report available bytes
|
||||
* @tty: tty device
|
||||
*
|
||||
* Report the number of characters buffered to be delivered to user
|
||||
* at this instant in time.
|
||||
*
|
||||
* Locking: gsm lock
|
||||
*/
|
||||
|
||||
static ssize_t gsmld_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* gsmld_flush_buffer - clean input queue
|
||||
* @tty: terminal device
|
||||
@@ -2830,7 +2815,6 @@ static struct tty_ldisc_ops tty_ldisc_packet = {
|
||||
.open = gsmld_open,
|
||||
.close = gsmld_close,
|
||||
.flush_buffer = gsmld_flush_buffer,
|
||||
.chars_in_buffer = gsmld_chars_in_buffer,
|
||||
.read = gsmld_read,
|
||||
.write = gsmld_write,
|
||||
.ioctl = gsmld_ioctl,
|
||||
|
Reference in New Issue
Block a user