public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	Chris Zankel <chris@zankel.net>,
	Max Filippov <jcmvbkbc@gmail.com>
Subject: [PATCH 01/36] tty: xtensa/iss: drop unneeded tty_operations hooks
Date: Thu, 10 Aug 2023 11:14:35 +0200	[thread overview]
Message-ID: <20230810091510.13006-2-jirislaby@kernel.org> (raw)
In-Reply-To: <20230810091510.13006-1-jirislaby@kernel.org>

All ::flush_chars(), ::hangup(), and ::wait_until_sent() from struct
tty_operations are optional. There is no need to provide them with
empty bodies.

tty_operations::put_char() needs not be provided if it is the same as
tty_operations::write(tty, &ch, 1).

So drop all of them.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/platforms/iss/console.c | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c
index 10b79d3c74e0..b40b73809dd8 100644
--- a/arch/xtensa/platforms/iss/console.c
+++ b/arch/xtensa/platforms/iss/console.c
@@ -82,32 +82,12 @@ static void rs_poll(struct timer_list *unused)
 		mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE);
 }
 
-
-static int rs_put_char(struct tty_struct *tty, unsigned char ch)
-{
-	return rs_write(tty, &ch, 1);
-}
-
-static void rs_flush_chars(struct tty_struct *tty)
-{
-}
-
 static unsigned int rs_write_room(struct tty_struct *tty)
 {
 	/* Let's say iss can always accept 2K characters.. */
 	return 2 * 1024;
 }
 
-static void rs_hangup(struct tty_struct *tty)
-{
-	/* Stub, once again.. */
-}
-
-static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
-{
-	/* Stub, once again.. */
-}
-
 static int rs_proc_show(struct seq_file *m, void *v)
 {
 	seq_printf(m, "serinfo:1.0 driver:0.1\n");
@@ -118,11 +98,7 @@ static const struct tty_operations serial_ops = {
 	.open = rs_open,
 	.close = rs_close,
 	.write = rs_write,
-	.put_char = rs_put_char,
-	.flush_chars = rs_flush_chars,
 	.write_room = rs_write_room,
-	.hangup = rs_hangup,
-	.wait_until_sent = rs_wait_until_sent,
 	.proc_show = rs_proc_show,
 };
 
-- 
2.41.0


  reply	other threads:[~2023-08-10  9:15 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10  9:14 [PATCH 00/36] tty: type unifications -- part I Jiri Slaby (SUSE)
2023-08-10  9:14 ` Jiri Slaby (SUSE) [this message]
2023-08-10 12:37   ` [PATCH 01/36] tty: xtensa/iss: drop unneeded tty_operations hooks Max Filippov
2023-08-10  9:14 ` [PATCH 02/36] tty: ldisc: document that ldops are optional Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 03/36] tty: remove dummy tty_ldisc_ops::poll() implementations Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 04/36] tty: n_null: remove optional ldops Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 05/36] tty: change tty_write_lock()'s ndelay parameter to bool Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 06/36] tty: tty_port: rename 'disc' to 'ld' Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 07/36] tty: drop tty_debug_wait_until_sent() Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 08/36] tty: make tty_change_softcar() more understandable Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 09/36] tty: make tty_port_client_operations operate with u8 Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 10/36] tty: make counts in tty_port_client_operations hooks size_t Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 11/36] tty: switch receive_buf() counts to size_t Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 12/36] tty: switch count in tty_ldisc_receive_buf() " Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 13/36] tty: can327: unify error paths in can327_ldisc_rx() Jiri Slaby (SUSE)
2023-08-11 21:32   ` Max Staudt
2023-08-10  9:14 ` [PATCH 14/36] tty: can327, move overflow test inside can327_ldisc_rx()'s loop Jiri Slaby (SUSE)
2023-08-11 21:34   ` Max Staudt
2023-08-10  9:14 ` [PATCH 15/36] tty: make tty_ldisc_ops::*buf*() hooks operate on size_t Jiri Slaby (SUSE)
2023-08-10 12:02   ` Mark Brown
2023-08-11 21:34   ` Max Staudt
2023-08-10  9:14 ` [PATCH 16/36] tty: use u8 for chars Jiri Slaby (SUSE)
2023-08-10 12:04   ` Mark Brown
2023-08-11 10:28   ` Ilpo Järvinen
2023-08-14  6:35     ` Jiri Slaby
2023-08-31 18:33     ` Andy Shevchenko
2023-08-11 21:34   ` Max Staudt
2023-08-10  9:14 ` [PATCH 17/36] tty: use u8 for flags Jiri Slaby (SUSE)
2023-08-10 12:05   ` Mark Brown
2023-08-11 21:35   ` Max Staudt
2023-08-10  9:14 ` [PATCH 18/36] misc: ti-st: make st_recv() conforming to tty_ldisc_ops::receive_buf() Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 19/36] tty: make char_buf_ptr()/flag_buf_ptr()'s offset unsigned Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 20/36] tty: tty_buffer: make all offsets unsigned Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 21/36] tty: don't pass write() to do_tty_write() Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 22/36] tty: rename and de-inline do_tty_write() Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 23/36] tty: use min() in iterate_tty_write() Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 24/36] tty: use ssize_t for iterate_tty_read() returned type Jiri Slaby (SUSE)
2023-08-10  9:14 ` [PATCH 25/36] tty: switch size and count types in iterate_tty_read() to size_t Jiri Slaby (SUSE)
2023-08-10  9:15 ` [PATCH 26/36] tty: use min() for size computation in iterate_tty_read() Jiri Slaby (SUSE)
2023-08-10  9:15 ` [PATCH 27/36] tty: propagate u8 data to tty_operations::write() Jiri Slaby (SUSE)
2023-08-11 11:52   ` Alexander Gordeev
2023-08-17 10:42     ` Jiri Slaby
2023-08-14 14:47   ` Geert Uytterhoeven
2023-08-17 10:53   ` Alexander Gordeev
2023-08-10  9:15 ` [PATCH 28/36] tty: propagate u8 data to tty_operations::put_char() Jiri Slaby (SUSE)
2023-08-14 14:44   ` Geert Uytterhoeven
2023-08-17 10:55   ` Alexander Gordeev
2023-08-10  9:15 ` [PATCH 29/36] tty: make tty_operations::write()'s count size_t Jiri Slaby (SUSE)
2023-08-14 17:58   ` Geert Uytterhoeven
2023-08-10  9:15 ` [PATCH 30/36] tty: audit: unify to u8 Jiri Slaby (SUSE)
2023-08-10  9:15 ` [PATCH 31/36] tty: ldops: " Jiri Slaby (SUSE)
2023-08-10  9:15 ` [PATCH 32/36] tty: hvc: convert counts to size_t Jiri Slaby (SUSE)
2023-08-10  9:15 ` [PATCH 33/36] tty: vcc: " Jiri Slaby (SUSE)
2023-08-10  9:15 ` [PATCH 34/36] tty: gdm724x: " Jiri Slaby (SUSE)
2023-08-10  9:42   ` Dan Carpenter
2023-08-10 10:08     ` Jiri Slaby
2023-08-10 10:39     ` [PATCH 34-and-three-quarters/36] tty: gdm724x: simplify gdm_tty_write() Jiri Slaby (SUSE)
2023-08-11  9:11       ` Ilpo Järvinen
2023-08-15 17:22   ` [PATCH 34/36] tty: gdm724x: convert counts to size_t Nathan Chancellor
2023-08-16  6:46     ` Jiri Slaby
2023-08-16  8:40       ` David Laight
2023-08-16  8:58         ` Jiri Slaby
2023-08-16  9:18           ` David Laight
2023-08-10  9:15 ` [PATCH 35/36] tty: hso: simplify hso_serial_write() Jiri Slaby (SUSE)
2023-08-10  9:15 ` [PATCH 36/36] tty: rfcomm: convert counts to size_t Jiri Slaby (SUSE)
2023-08-11 10:26 ` [PATCH 00/36] tty: type unifications -- part I Ilpo Järvinen
2023-08-14  6:59   ` Jiri Slaby
2023-08-14 14:47     ` Ilpo Järvinen

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=20230810091510.13006-2-jirislaby@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=chris@zankel.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jcmvbkbc@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox