mirror of
https://github.com/armbian/linux-cix.git
synced 2026-01-06 12:30:45 -08:00
tty: make tty_operations::write_room return uint
Line disciplines expect a positive value or zero returned from tty->ops->write_room (invoked by tty_write_room). So make this assumption explicit by using unsigned int as a return value. Both of tty->ops->write_room and tty_write_room. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Acked-by: Alex Elder <elder@linaro.org> Acked-by: Max Filippov <jcmvbkbc@gmail.com> # xtensa Acked-by: David Sterba <dsterba@suse.com> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> 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: Jeff Dike <jdike@addtoit.com> Cc: Richard Weinberger <richard@nod.at> Cc: Chris Zankel <chris@zankel.net> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Cc: Jens Taprogge <jens.taprogge@taprogge.org> Cc: Karsten Keil <isdn@linux-pingi.de> Cc: Scott Branden <scott.branden@broadcom.com> Cc: Ulf Hansson <ulf.hansson@linaro.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jakub Kicinski <kuba@kernel.org> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Cc: David Lin <dtwlin@gmail.com> Cc: Johan Hovold <johan@kernel.org> Cc: Jiri Kosina <jikos@kernel.org> Cc: Shawn Guo <shawnguo@kernel.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Oliver Neukum <oneukum@suse.com> Cc: Felipe Balbi <balbi@kernel.org> Cc: Mathias Nyman <mathias.nyman@intel.com> Cc: Marcel Holtmann <marcel@holtmann.org> Cc: Johan Hedberg <johan.hedberg@gmail.com> Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com> Link: https://lore.kernel.org/r/20210505091928.22010-23-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0f29b503bd
commit
03b3b1a240
@@ -142,7 +142,7 @@ srmcons_write(struct tty_struct *tty,
|
||||
return count;
|
||||
}
|
||||
|
||||
static int
|
||||
static unsigned int
|
||||
srmcons_write_room(struct tty_struct *tty)
|
||||
{
|
||||
return 512;
|
||||
|
||||
@@ -85,7 +85,7 @@ static int nfcon_tty_put_char(struct tty_struct *tty, unsigned char ch)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int nfcon_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int nfcon_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ static int pdc_console_tty_write(struct tty_struct *tty, const unsigned char *bu
|
||||
return count;
|
||||
}
|
||||
|
||||
static int pdc_console_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int pdc_console_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
return 32768; /* no limit, no buffer used */
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ static irqreturn_t line_interrupt(int irq, void *data)
|
||||
*
|
||||
* Should be called while holding line->lock (this does not modify data).
|
||||
*/
|
||||
static int write_room(struct line *line)
|
||||
static unsigned int write_room(struct line *line)
|
||||
{
|
||||
int n;
|
||||
|
||||
@@ -47,11 +47,11 @@ static int write_room(struct line *line)
|
||||
return n - 1;
|
||||
}
|
||||
|
||||
int line_write_room(struct tty_struct *tty)
|
||||
unsigned int line_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct line *line = tty->driver_data;
|
||||
unsigned long flags;
|
||||
int room;
|
||||
unsigned int room;
|
||||
|
||||
spin_lock_irqsave(&line->lock, flags);
|
||||
room = write_room(line);
|
||||
|
||||
@@ -70,7 +70,7 @@ extern void line_set_termios(struct tty_struct *tty, struct ktermios * old);
|
||||
extern int line_chars_in_buffer(struct tty_struct *tty);
|
||||
extern void line_flush_buffer(struct tty_struct *tty);
|
||||
extern void line_flush_chars(struct tty_struct *tty);
|
||||
extern int line_write_room(struct tty_struct *tty);
|
||||
extern unsigned int line_write_room(struct tty_struct *tty);
|
||||
extern void line_throttle(struct tty_struct *tty);
|
||||
extern void line_unthrottle(struct tty_struct *tty);
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ static void rs_flush_chars(struct tty_struct *tty)
|
||||
{
|
||||
}
|
||||
|
||||
static int rs_write_room(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;
|
||||
|
||||
@@ -1609,7 +1609,7 @@ cleanup:
|
||||
|
||||
/* Return the count of free bytes in transmit buffer
|
||||
*/
|
||||
static int mgslpc_write_room(struct tty_struct *tty)
|
||||
static unsigned int mgslpc_write_room(struct tty_struct *tty)
|
||||
{
|
||||
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
|
||||
int ret;
|
||||
|
||||
@@ -132,7 +132,7 @@ static int tpk_write(struct tty_struct *tty,
|
||||
/*
|
||||
* TTY operations write_room function.
|
||||
*/
|
||||
static int tpk_write_room(struct tty_struct *tty)
|
||||
static unsigned int tpk_write_room(struct tty_struct *tty)
|
||||
{
|
||||
return TPK_MAX_ROOM;
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ static int ipoctal_write_tty(struct tty_struct *tty,
|
||||
return char_copied;
|
||||
}
|
||||
|
||||
static int ipoctal_write_room(struct tty_struct *tty)
|
||||
static unsigned int ipoctal_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct ipoctal_channel *channel = tty->driver_data;
|
||||
|
||||
|
||||
@@ -1175,14 +1175,14 @@ static void capinc_tty_flush_chars(struct tty_struct *tty)
|
||||
handle_minor_recv(mp);
|
||||
}
|
||||
|
||||
static int capinc_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int capinc_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct capiminor *mp = tty->driver_data;
|
||||
int room;
|
||||
unsigned int room;
|
||||
|
||||
room = CAPINC_MAX_SENDQUEUE-skb_queue_len(&mp->outqueue);
|
||||
room *= CAPI_MAX_BLKSIZE;
|
||||
pr_debug("capinc_tty_write_room = %d\n", room);
|
||||
pr_debug("capinc_tty_write_room = %u\n", room);
|
||||
return room;
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ static int bcm_vk_tty_write(struct tty_struct *tty,
|
||||
return count;
|
||||
}
|
||||
|
||||
static int bcm_vk_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int bcm_vk_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct bcm_vk *vk = dev_get_drvdata(tty->dev);
|
||||
|
||||
|
||||
@@ -797,7 +797,7 @@ static int sdio_uart_write(struct tty_struct *tty, const unsigned char *buf,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sdio_uart_write_room(struct tty_struct *tty)
|
||||
static unsigned int sdio_uart_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct sdio_uart_port *port = tty->driver_data;
|
||||
return FIFO_SIZE - kfifo_len(&port->xmit_fifo);
|
||||
|
||||
@@ -1357,10 +1357,10 @@ out:
|
||||
}
|
||||
|
||||
/* how much room is there for writing */
|
||||
static int hso_serial_write_room(struct tty_struct *tty)
|
||||
static unsigned int hso_serial_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct hso_serial *serial = tty->driver_data;
|
||||
int room;
|
||||
unsigned int room;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&serial->serial_lock, flags);
|
||||
|
||||
@@ -924,7 +924,7 @@ static void tty3215_close(struct tty_struct *tty, struct file * filp)
|
||||
/*
|
||||
* Returns the amount of free space in the output buffer.
|
||||
*/
|
||||
static int tty3215_write_room(struct tty_struct *tty)
|
||||
static unsigned int tty3215_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
|
||||
|
||||
@@ -86,12 +86,12 @@ sclp_tty_close(struct tty_struct *tty, struct file *filp)
|
||||
* a string of newlines. Every newline creates a new message which
|
||||
* needs 82 bytes.
|
||||
*/
|
||||
static int
|
||||
static unsigned int
|
||||
sclp_tty_write_room (struct tty_struct *tty)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct list_head *l;
|
||||
int count;
|
||||
unsigned int count;
|
||||
|
||||
spin_lock_irqsave(&sclp_tty_lock, flags);
|
||||
count = 0;
|
||||
|
||||
@@ -609,12 +609,12 @@ sclp_vt220_flush_chars(struct tty_struct *tty)
|
||||
* to change as output buffers get emptied, or if the output flow
|
||||
* control is acted.
|
||||
*/
|
||||
static int
|
||||
static unsigned int
|
||||
sclp_vt220_write_room(struct tty_struct *tty)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct list_head *l;
|
||||
int count;
|
||||
unsigned int count;
|
||||
|
||||
spin_lock_irqsave(&sclp_vt220_lock, flags);
|
||||
count = 0;
|
||||
|
||||
@@ -1071,7 +1071,7 @@ static void tty3270_cleanup(struct tty_struct *tty)
|
||||
/*
|
||||
* We always have room.
|
||||
*/
|
||||
static int
|
||||
static unsigned int
|
||||
tty3270_write_room(struct tty_struct *tty)
|
||||
{
|
||||
return INT_MAX;
|
||||
|
||||
@@ -1113,16 +1113,16 @@ static int fwtty_write(struct tty_struct *tty, const unsigned char *buf, int c)
|
||||
return (n < 0) ? 0 : n;
|
||||
}
|
||||
|
||||
static int fwtty_write_room(struct tty_struct *tty)
|
||||
static unsigned int fwtty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct fwtty_port *port = tty->driver_data;
|
||||
int n;
|
||||
unsigned int n;
|
||||
|
||||
spin_lock_bh(&port->lock);
|
||||
n = dma_fifo_avail(&port->tx_fifo);
|
||||
spin_unlock_bh(&port->lock);
|
||||
|
||||
fwtty_dbg(port, "%d\n", n);
|
||||
fwtty_dbg(port, "%u\n", n);
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ static int gdm_tty_write(struct tty_struct *tty, const unsigned char *buf,
|
||||
return len;
|
||||
}
|
||||
|
||||
static int gdm_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int gdm_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct gdm *gdm = tty->driver_data;
|
||||
|
||||
|
||||
@@ -440,7 +440,7 @@ static int gb_tty_write(struct tty_struct *tty, const unsigned char *buf,
|
||||
return count;
|
||||
}
|
||||
|
||||
static int gb_tty_write_room(struct tty_struct *tty)
|
||||
static unsigned int gb_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct gb_tty *gb_tty = tty->driver_data;
|
||||
unsigned long flags;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user