All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Matt Turner <mattst88@gmail.com>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>, Chris Zankel <chris@zankel.net>,
	Max Filippov <jcmvbkbc@gmail.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH 25/35] tty: remove tty_operations::chars_in_buffer for non-buffering
Date: Thu, 6 May 2021 07:47:04 +0200	[thread overview]
Message-ID: <40c8a109-9161-621e-f8cd-c43fdba6dac2@kernel.org> (raw)
In-Reply-To: <20210505091928.22010-26-jslaby@suse.cz>

On 05. 05. 21, 11:19, Jiri Slaby wrote:
> The only user of tty_ops::chars_in_buffer is tty_chars_in_buffer. And it
> considers tty_ops::chars_in_buffer optional. In case it's NULL, zero is
> returned. So remove all those chars_in_buffer from tty_ops which return
> zero. (Zero means such driver doesn't buffer.)
> 
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>


> c: Richard Henderson <rth@twiddle.net>

Uh, "C" is a fugitive. Wanted dead or alive.

So should I send a v2 with:
Cc: Richard Henderson <rth@twiddle.net>
?

> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> Cc: Helge Deller <deller@gmx.de>
> Cc: Chris Zankel <chris@zankel.net>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: Heiko Carstens <hca@linux.ibm.com>
> Cc: Vasily Gorbik <gor@linux.ibm.com>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>   arch/alpha/kernel/srmcons.c         |  7 -------
>   arch/parisc/kernel/pdc_cons.c       |  6 ------
>   arch/xtensa/platforms/iss/console.c |  7 -------
>   drivers/s390/char/tty3270.c         | 12 ------------
>   drivers/tty/pty.c                   | 17 -----------------
>   drivers/tty/vt/vt.c                 |  6 ------
>   6 files changed, 55 deletions(-)
> 
> diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c
> index 2110b7e7f988..fc03471a0b0f 100644
> --- a/arch/alpha/kernel/srmcons.c
> +++ b/arch/alpha/kernel/srmcons.c
> @@ -148,12 +148,6 @@ srmcons_write_room(struct tty_struct *tty)
>   	return 512;
>   }
>   
> -static int
> -srmcons_chars_in_buffer(struct tty_struct *tty)
> -{
> -	return 0;
> -}
> -
>   static int
>   srmcons_open(struct tty_struct *tty, struct file *filp)
>   {
> @@ -200,7 +194,6 @@ static const struct tty_operations srmcons_ops = {
>   	.close		= srmcons_close,
>   	.write		= srmcons_write,
>   	.write_room	= srmcons_write_room,
> -	.chars_in_buffer= srmcons_chars_in_buffer,
>   };
>   
>   static int __init
> diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
> index fe2ed0bbd07e..39ccad063533 100644
> --- a/arch/parisc/kernel/pdc_cons.c
> +++ b/arch/parisc/kernel/pdc_cons.c
> @@ -108,17 +108,11 @@ static unsigned int pdc_console_tty_write_room(struct tty_struct *tty)
>   	return 32768; /* no limit, no buffer used */
>   }
>   
> -static int pdc_console_tty_chars_in_buffer(struct tty_struct *tty)
> -{
> -	return 0; /* no buffer */
> -}
> -
>   static const struct tty_operations pdc_console_tty_ops = {
>   	.open = pdc_console_tty_open,
>   	.close = pdc_console_tty_close,
>   	.write = pdc_console_tty_write,
>   	.write_room = pdc_console_tty_write_room,
> -	.chars_in_buffer = pdc_console_tty_chars_in_buffer,
>   };
>   
>   static void pdc_console_poll(struct timer_list *unused)
> diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c
> index 98ac3a7fdb0a..21184488c277 100644
> --- a/arch/xtensa/platforms/iss/console.c
> +++ b/arch/xtensa/platforms/iss/console.c
> @@ -106,12 +106,6 @@ static unsigned int rs_write_room(struct tty_struct *tty)
>   	return 2 * 1024;
>   }
>   
> -static int rs_chars_in_buffer(struct tty_struct *tty)
> -{
> -	/* the iss doesn't buffer characters */
> -	return 0;
> -}
> -
>   static void rs_hangup(struct tty_struct *tty)
>   {
>   	/* Stub, once again.. */
> @@ -135,7 +129,6 @@ static const struct tty_operations serial_ops = {
>   	.put_char = rs_put_char,
>   	.flush_chars = rs_flush_chars,
>   	.write_room = rs_write_room,
> -	.chars_in_buffer = rs_chars_in_buffer,
>   	.hangup = rs_hangup,
>   	.wait_until_sent = rs_wait_until_sent,
>   	.proc_show = rs_proc_show,
> diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
> index 82d4c961ed06..ba1fbce63fee 100644
> --- a/drivers/s390/char/tty3270.c
> +++ b/drivers/s390/char/tty3270.c
> @@ -1756,17 +1756,6 @@ tty3270_flush_chars(struct tty_struct *tty)
>   	}
>   }
>   
> -/*
> - * Returns the number of characters in the output buffer. This is
> - * used in tty_wait_until_sent to wait until all characters have
> - * appeared on the screen.
> - */
> -static int
> -tty3270_chars_in_buffer(struct tty_struct *tty)
> -{
> -	return 0;
> -}
> -
>   static void
>   tty3270_flush_buffer(struct tty_struct *tty)
>   {
> @@ -1892,7 +1881,6 @@ static const struct tty_operations tty3270_ops = {
>   	.put_char = tty3270_put_char,
>   	.flush_chars = tty3270_flush_chars,
>   	.write_room = tty3270_write_room,
> -	.chars_in_buffer = tty3270_chars_in_buffer,
>   	.flush_buffer = tty3270_flush_buffer,
>   	.throttle = tty3270_throttle,
>   	.unthrottle = tty3270_unthrottle,
> diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
> index eb8556b19592..5ada7e9381eb 100644
> --- a/drivers/tty/pty.c
> +++ b/drivers/tty/pty.c
> @@ -143,19 +143,6 @@ static unsigned int pty_write_room(struct tty_struct *tty)
>   	return tty_buffer_space_avail(tty->link->port);
>   }
>   
> -/**
> - *	pty_chars_in_buffer	-	characters currently in our tx queue
> - *	@tty: our tty
> - *
> - *	Report how much we have in the transmit queue. As everything is
> - *	instantly at the other end this is easy to implement.
> - */
> -
> -static int pty_chars_in_buffer(struct tty_struct *tty)
> -{
> -	return 0;
> -}
> -
>   /* Set the lock flag on a pty */
>   static int pty_set_lock(struct tty_struct *tty, int __user *arg)
>   {
> @@ -525,7 +512,6 @@ static const struct tty_operations master_pty_ops_bsd = {
>   	.write = pty_write,
>   	.write_room = pty_write_room,
>   	.flush_buffer = pty_flush_buffer,
> -	.chars_in_buffer = pty_chars_in_buffer,
>   	.unthrottle = pty_unthrottle,
>   	.ioctl = pty_bsd_ioctl,
>   	.compat_ioctl = pty_bsd_compat_ioctl,
> @@ -541,7 +527,6 @@ static const struct tty_operations slave_pty_ops_bsd = {
>   	.write = pty_write,
>   	.write_room = pty_write_room,
>   	.flush_buffer = pty_flush_buffer,
> -	.chars_in_buffer = pty_chars_in_buffer,
>   	.unthrottle = pty_unthrottle,
>   	.set_termios = pty_set_termios,
>   	.cleanup = pty_cleanup,
> @@ -776,7 +761,6 @@ static const struct tty_operations ptm_unix98_ops = {
>   	.write = pty_write,
>   	.write_room = pty_write_room,
>   	.flush_buffer = pty_flush_buffer,
> -	.chars_in_buffer = pty_chars_in_buffer,
>   	.unthrottle = pty_unthrottle,
>   	.ioctl = pty_unix98_ioctl,
>   	.compat_ioctl = pty_unix98_compat_ioctl,
> @@ -794,7 +778,6 @@ static const struct tty_operations pty_unix98_ops = {
>   	.write = pty_write,
>   	.write_room = pty_write_room,
>   	.flush_buffer = pty_flush_buffer,
> -	.chars_in_buffer = pty_chars_in_buffer,
>   	.unthrottle = pty_unthrottle,
>   	.set_termios = pty_set_termios,
>   	.start = pty_start,
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 96c130714930..b838f656f4cd 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -3270,11 +3270,6 @@ static unsigned int con_write_room(struct tty_struct *tty)
>   	return 32768;		/* No limit, really; we're not buffering */
>   }
>   
> -static int con_chars_in_buffer(struct tty_struct *tty)
> -{
> -	return 0;		/* we're not buffering */
> -}
> -
>   /*
>    * con_throttle and con_unthrottle are only used for
>    * paste_selection(), which has to stuff in a large number of
> @@ -3521,7 +3516,6 @@ static const struct tty_operations con_ops = {
>   	.write_room = con_write_room,
>   	.put_char = con_put_char,
>   	.flush_chars = con_flush_chars,
> -	.chars_in_buffer = con_chars_in_buffer,
>   	.ioctl = vt_ioctl,
>   #ifdef CONFIG_COMPAT
>   	.compat_ioctl = vt_compat_ioctl,
> 


-- 
js
suse labs

  parent reply	other threads:[~2021-05-06  5:47 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05  9:18 [PATCH 00/35] tty cleanup for 5.14 Jiri Slaby
2021-05-05  9:18 ` [PATCH 01/35] tty: remove broken r3964 line discipline Jiri Slaby
2021-05-05  9:26   ` Greg KH
2021-05-05  9:18 ` [PATCH 02/35] n_tty: remove n_tty_receive_char wrapper Jiri Slaby
2021-05-05  9:18 ` [PATCH 03/35] n_tty: remove n_tty_receive_char_fast Jiri Slaby
2021-05-05  9:18 ` [PATCH 04/35] n_tty: drop n_tty_receive_buf_fast Jiri Slaby
2021-05-05  9:18 ` [PATCH 05/35] n_tty: drop parmrk_dbl from n_tty_receive_char Jiri Slaby
2021-05-05  9:18 ` [PATCH 06/35] n_tty: move lnext handling Jiri Slaby
2021-05-05  9:19 ` [PATCH 07/35] n_tty: make n_tty_receive_char_special return void Jiri Slaby
2021-05-05  9:19 ` [PATCH 08/35] n_tty: do only one cp dereference in n_tty_receive_buf_standard Jiri Slaby
2021-05-05  9:19 ` [PATCH 09/35] n_tty: invert TTY_NORMAL condition " Jiri Slaby
2021-05-05  9:19 ` [PATCH 10/35] n_tty: remove superfluous return from n_tty_receive_signal_char Jiri Slaby
2021-05-05  9:19 ` [PATCH 11/35] tty: make fp of tty_ldisc_ops::receive_buf{,2} const Jiri Slaby
2021-05-05  9:19 ` [PATCH 12/35] tty: cumulate and document tty_struct::flow* members Jiri Slaby
2021-05-05  9:19 ` [PATCH 13/35] tty: cumulate and document tty_struct::ctrl* members Jiri Slaby
2021-05-05  9:19 ` [PATCH 14/35] tty: set tty_ldisc_ops::num statically Jiri Slaby
2021-05-05  9:19 ` [PATCH 15/35] n_gsm: use goto-failpaths in gsm_init Jiri Slaby
2021-05-05  9:19 ` [PATCH 16/35] tty: make tty_ldisc_ops a param in tty_unregister_ldisc Jiri Slaby
2021-05-05  9:19 ` [PATCH 17/35] tty: drop tty_ldisc_ops::refcount Jiri Slaby
2021-05-05  9:19 ` [PATCH 18/35] tty: no checking of tty_unregister_ldisc Jiri Slaby
2021-05-05  9:19 ` [PATCH 19/35] tty: return void from tty_unregister_ldisc Jiri Slaby
2021-05-05  9:19 ` [PATCH 20/35] ti-st: use goto-failpath in st_core_init Jiri Slaby
2021-05-05  9:19 ` [PATCH 21/35] ti-st: use tty_write_room Jiri Slaby
2021-05-05  9:19 ` [PATCH 22/35] tty: make tty_operations::write_room return uint Jiri Slaby
2021-05-05  9:25   ` Geert Uytterhoeven
2021-05-05 10:34   ` Anton Ivanov
2021-05-05 10:43   ` David Sterba
2021-05-05 11:53   ` Max Filippov
2021-05-05 12:15   ` Alex Elder
2021-05-10 11:27   ` Laurentiu Tudor
2021-05-05  9:19 ` [PATCH 23/35] USB: serial: make usb_serial_driver::write_room " Jiri Slaby
2021-05-19  9:07   ` Johan Hovold
2021-05-05  9:19 ` [PATCH 24/35] tty: make tty_buffer_space_avail " Jiri Slaby
2021-05-05  9:19 ` [PATCH 25/35] tty: remove tty_operations::chars_in_buffer for non-buffering Jiri Slaby
2021-05-05 11:51   ` Max Filippov
2021-05-06  5:47   ` Jiri Slaby [this message]
2021-05-06  5:56     ` Greg KH
2021-05-05  9:19 ` [PATCH 26/35] tty: make tty_operations::chars_in_buffer return uint Jiri Slaby
2021-05-05 10:34   ` Anton Ivanov
2021-05-05 10:43   ` David Sterba
2021-05-05  9:19 ` [PATCH 27/35] serial: make usb_serial_driver::chars_in_buffer " Jiri Slaby
2021-05-19  9:09   ` Johan Hovold
2021-05-05  9:19 ` [PATCH 28/35] nozomi: simplify ntty_chars_in_buffer Jiri Slaby
2021-05-05  9:19 ` [PATCH 29/35] USB: serial: digi_acceleport, simplify digi_chars_in_buffer Jiri Slaby
2021-05-19  9:11   ` Johan Hovold
2021-05-05  9:19 ` [PATCH 30/35] tty: remove empty tty_operations::flush_buffer Jiri Slaby
2021-05-05  9:19 ` [PATCH 31/35] tty: remove empty tty_operations::set_termios Jiri Slaby
2021-05-05 10:34   ` Anton Ivanov
2021-05-05  9:19 ` [PATCH 32/35] isdn: capi, remove optional tty ops Jiri Slaby
2021-05-05  9:19 ` [PATCH 33/35] isdn: capi, drop useless pr_debugs Jiri Slaby
2021-05-05  9:19 ` [PATCH 34/35] tty: make tty_get_byte_size available Jiri Slaby
2021-05-06  7:16   ` Joe Perches
2021-05-06  7:19     ` Jiri Slaby
     [not found]     ` <CAHp75Vfq6ABW7ukwaKmZOF2DszmuHD28S=wcLcFowvRdXTnWmg@mail.gmail.com>
2021-05-06  8:31       ` Jiri Slaby
2021-05-06  9:33         ` Andy Shevchenko
2021-05-06  8:35       ` Joe Perches
2021-05-10  7:00   ` [PATCH v2 " Jiri Slaby
2021-05-10  9:47     ` Johan Hovold
2021-05-13  7:24       ` Jiri Slaby
2021-05-13  9:41         ` Johan Hovold
2021-05-05  9:19 ` [PATCH 35/35] tty: make use of tty_get_byte_size Jiri Slaby
2021-05-10  9:59   ` Johan Hovold
2021-05-13 15:04 ` [PATCH 00/35] tty cleanup for 5.14 Greg KH
2021-05-13 16:20   ` Johan Hovold
2021-05-13 16:29     ` Greg KH
2021-05-14  8:11       ` Johan Hovold
2021-06-10  9:02 ` [PATCH v3 1/4] tty: make tty_get_{char,frame}_size available Jiri Slaby
2021-06-10  9:02   ` [PATCH v3 2/4] mxs-auart: redefine AUART_LINECTRL_WLEN to accept bits count Jiri Slaby
2021-06-10  9:02   ` [PATCH v3 3/4] cypress_m8: switch data_bits to real character bits Jiri Slaby
2021-06-10  9:02   ` [PATCH v3 4/4] tty: make use of tty_get_{char,frame}_size Jiri Slaby
2021-06-10 15:15     ` Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40c8a109-9161-621e-f8cd-c43fdba6dac2@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=borntraeger@de.ibm.com \
    --cc=chris@zankel.net \
    --cc=deller@gmx.de \
    --cc=gor@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hca@linux.ibm.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=jcmvbkbc@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.