From: Jiri Slaby <jslaby@suse.cz>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 44/44] tty: make everyone's write_room return >= 0
Date: Tue, 2 Mar 2021 07:22:14 +0100 [thread overview]
Message-ID: <20210302062214.29627-44-jslaby@suse.cz> (raw)
In-Reply-To: <20210302062214.29627-1-jslaby@suse.cz>
The tty line disciplines don't expect tty_operations::write_room to
return negative values. Fix the five drivers which violate this.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/staging/gdm724x/gdm_tty.c | 2 +-
drivers/tty/ipwireless/tty.c | 4 ++--
drivers/tty/n_gsm.c | 2 +-
drivers/tty/vcc.c | 2 +-
drivers/usb/serial/mos7720.c | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
index 6e813693a766..0ccc8c24e754 100644
--- a/drivers/staging/gdm724x/gdm_tty.c
+++ b/drivers/staging/gdm724x/gdm_tty.c
@@ -188,7 +188,7 @@ static int gdm_tty_write_room(struct tty_struct *tty)
struct gdm *gdm = tty->driver_data;
if (!GDM_TTY_READY(gdm))
- return -ENODEV;
+ return 0;
return WRITE_SIZE;
}
diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
index 1836746991b5..99bb2f149ff5 100644
--- a/drivers/tty/ipwireless/tty.c
+++ b/drivers/tty/ipwireless/tty.c
@@ -235,10 +235,10 @@ static int ipw_write_room(struct tty_struct *linux_tty)
/* FIXME: Exactly how is the tty object locked here .. */
if (!tty)
- return -ENODEV;
+ return 0;
if (!tty->port.count)
- return -EINVAL;
+ return 0;
room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued;
if (room < 0)
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index da10e975829f..9e12f9cb1a98 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -3048,7 +3048,7 @@ static int gsmtty_write_room(struct tty_struct *tty)
{
struct gsm_dlci *dlci = tty->driver_data;
if (dlci->state == DLCI_CLOSED)
- return -EINVAL;
+ return 0;
return TX_SIZE - kfifo_len(&dlci->fifo);
}
diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c
index 3106df98558a..0a3a71e14df4 100644
--- a/drivers/tty/vcc.c
+++ b/drivers/tty/vcc.c
@@ -878,7 +878,7 @@ static int vcc_write_room(struct tty_struct *tty)
port = vcc_get_ne(tty->index);
if (unlikely(!port)) {
pr_err("VCC: write_room: Failed to find VCC port\n");
- return -ENODEV;
+ return 0;
}
num = VCC_BUFF_LEN - port->chars_in_buffer;
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 701dfb32b129..bb3d39307d93 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1042,7 +1042,7 @@ static int mos7720_write_room(struct tty_struct *tty)
mos7720_port = usb_get_serial_port_data(port);
if (mos7720_port == NULL)
- return -ENODEV;
+ return 0;
/* FIXME: Locking */
for (i = 0; i < NUM_URBS; ++i) {
--
2.30.1
next prev parent reply other threads:[~2021-03-02 8:26 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 6:21 [PATCH 01/44] MAINTAINERS: orphan mxser Jiri Slaby
2021-03-02 6:21 ` [PATCH 02/44] MAINTAINERS: drop cyclades.com reference Jiri Slaby
2021-03-02 6:21 ` [PATCH 03/44] PCI: remove synclink entries from pci_ids Jiri Slaby
2021-03-06 23:47 ` Krzysztof Wilczyński
2021-03-12 22:12 ` Bjorn Helgaas
2021-03-02 6:21 ` [PATCH 04/44] vgacon: comment on vga_rolled_over Jiri Slaby
2021-03-11 13:08 ` Daniel Vetter
2021-03-02 6:21 ` [PATCH 05/44] tty: cyclades, remove this orphan Jiri Slaby
2021-03-02 6:21 ` [PATCH 06/44] tty: isicom, " Jiri Slaby
2021-03-02 6:21 ` [PATCH 07/44] tty: rocket, remove the driver Jiri Slaby
2021-03-02 6:21 ` [PATCH 08/44] tty: remove TTY_LDISC_MAGIC Jiri Slaby
2021-03-02 6:21 ` [PATCH 09/44] tty: n_tty, set tty_ldisc_ops::owner Jiri Slaby
2021-03-02 6:21 ` [PATCH 10/44] tty: imx, use ms_to_ktime Jiri Slaby
2021-03-02 6:59 ` Uwe Kleine-König
2021-03-02 6:21 ` [PATCH 11/44] tty: 8250, " Jiri Slaby
2021-03-02 6:21 ` [PATCH 12/44] tty: 8250, cleanup em485 timers Jiri Slaby
2021-03-02 6:21 ` [PATCH 13/44] tty: 8250/serial_cs, propagate errors in simple_config Jiri Slaby
2021-03-02 6:21 ` [PATCH 14/44] net: caif: inline register_ldisc Jiri Slaby
2021-03-02 6:21 ` [PATCH 15/44] net: nfc: nci: remove memset of nci_uart_drivers Jiri Slaby
2021-03-02 6:21 ` [PATCH 16/44] net: nfc: nci: drop nci_uart_ops::recv_buf Jiri Slaby
2021-03-02 6:21 ` [PATCH 17/44] net: nfc: nci: drop nci_uart_default_recv Jiri Slaby
2021-03-02 6:21 ` [PATCH 18/44] tty: con3215, remove tasklet for tty_wakeup Jiri Slaby
2021-03-02 6:21 ` [PATCH 19/44] tty: con3215, remove unneeded tty checks Jiri Slaby
2021-03-02 6:21 ` [PATCH 20/44] tty: con3215, remove tty->driver_data casts Jiri Slaby
2021-03-02 6:21 ` [PATCH 21/44] tty: jsm_tty, make char+error handling readable Jiri Slaby
2021-03-02 6:21 ` [PATCH 22/44] tty: nozomi, remove struct buffer Jiri Slaby
2021-03-02 6:21 ` [PATCH 23/44] tty: nozomi, remove init/exit messages Jiri Slaby
2021-03-02 6:21 ` [PATCH 24/44] tty: nozomi, remove useless debug prints Jiri Slaby
2021-03-02 6:21 ` [PATCH 25/44] tty: vcc, make globals static Jiri Slaby
2021-03-02 6:21 ` [PATCH 26/44] tty: vcc, drop version dump Jiri Slaby
2021-03-02 6:21 ` [PATCH 27/44] tty: vcc, use name strings directly Jiri Slaby
2021-03-02 6:21 ` [PATCH 28/44] tty: vcc, remove useless tty checks Jiri Slaby
2021-03-02 6:21 ` [PATCH 29/44] tty: xtensa/iss, drop serial_version & serial_name Jiri Slaby
2021-03-02 6:45 ` Max Filippov
2021-03-02 6:22 ` [PATCH 30/44] tty: xtensa/iss, don't reassign to tty->port Jiri Slaby
2021-03-02 7:12 ` Max Filippov
2021-03-02 6:22 ` [PATCH 31/44] tty: xtensa/iss, remove stale comments Jiri Slaby
2021-03-02 6:49 ` Max Filippov
2021-03-02 6:22 ` [PATCH 32/44] tty: xtensa/iss, setup the timer statically Jiri Slaby
2021-03-02 6:52 ` Max Filippov
2021-03-02 6:22 ` [PATCH 33/44] tty: xtensa/iss, make rs_init static Jiri Slaby
2021-03-02 6:55 ` Max Filippov
2021-03-02 6:22 ` [PATCH 34/44] tty: do not check tty_unregister_driver's return value Jiri Slaby
2021-03-02 6:57 ` Max Filippov
2021-03-02 11:14 ` David Sterba
2021-03-02 6:22 ` [PATCH 35/44] tty: let tty_unregister_driver return void Jiri Slaby
2021-03-02 6:22 ` [PATCH 36/44] tty: localise ptychar and make it const Jiri Slaby
2021-03-02 6:22 ` [PATCH 37/44] USB: serial/keyspan, drop unneeded forward declarations Jiri Slaby
2021-03-03 19:17 ` Greg KH
2021-03-05 10:10 ` Johan Hovold
2021-03-15 8:43 ` Johan Hovold
2021-03-02 6:22 ` [PATCH 38/44] USB: serial/io_edgeport, " Jiri Slaby
2021-03-03 19:17 ` Greg KH
2021-03-02 6:22 ` [PATCH 39/44] tty: synclink_gt, " Jiri Slaby
2021-03-02 6:22 ` [PATCH 40/44] tty: hvc, " Jiri Slaby
2021-03-02 19:09 ` Tyrel Datwyler
2021-03-03 7:44 ` Uwe Kleine-König
2021-03-02 6:22 ` [PATCH 41/44] tty: n_gsm, remove duplicates of parameters Jiri Slaby
2021-03-02 6:22 ` [PATCH 42/44] tty: cleanup tty_chars_in_buffer Jiri Slaby
2021-03-02 6:22 ` [PATCH 43/44] tty: make everyone's chars_in_buffer return >= 0 Jiri Slaby
2021-03-02 6:22 ` Jiri Slaby [this message]
2021-03-05 10:18 ` [PATCH 44/44] tty: make everyone's write_room " Johan Hovold
2021-03-03 19:19 ` [PATCH 01/44] MAINTAINERS: orphan mxser Greg KH
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=20210302062214.29627-44-jslaby@suse.cz \
--to=jslaby@suse.cz \
--cc=gregkh@linuxfoundation.org \
--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;
as well as URLs for NNTP newsgroup(s).