2021-05-05 12:19:26

by Alex Elder

[permalink] [raw]
Subject: Re: [PATCH 22/35] tty: make tty_operations::write_room return uint

On 5/5/21 4:19 AM, Jiri Slaby wrote:
> 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 <[email protected]>
> Cc: Richard Henderson <[email protected]>
> Cc: Ivan Kokshaysky <[email protected]>
> Cc: Matt Turner <[email protected]>
> Cc: Geert Uytterhoeven <[email protected]>
> Cc: "James E.J. Bottomley" <[email protected]>
> Cc: Helge Deller <[email protected]>
> Cc: Jeff Dike <[email protected]>
> Cc: Richard Weinberger <[email protected]>
> Cc: Anton Ivanov <[email protected]>
> Cc: Chris Zankel <[email protected]>
> Cc: Max Filippov <[email protected]>
> Cc: Arnd Bergmann <[email protected]>
> Cc: Samuel Iglesias Gonsalvez <[email protected]>
> Cc: Jens Taprogge <[email protected]>
> Cc: Karsten Keil <[email protected]>
> Cc: Scott Branden <[email protected]>
> Cc: Ulf Hansson <[email protected]>
> Cc: "David S. Miller" <[email protected]>
> Cc: Jakub Kicinski <[email protected]>
> Cc: Heiko Carstens <[email protected]>
> Cc: Vasily Gorbik <[email protected]>
> Cc: Christian Borntraeger <[email protected]>
> Cc: David Lin <[email protected]>
> Cc: Johan Hovold <[email protected]>
> Cc: Alex Elder <[email protected]>
> Cc: Laurentiu Tudor <[email protected]>
> Cc: Jiri Kosina <[email protected]>
> Cc: David Sterba <[email protected]>
> Cc: Shawn Guo <[email protected]>
> Cc: Sascha Hauer <[email protected]>
> Cc: Oliver Neukum <[email protected]>
> Cc: Felipe Balbi <[email protected]>
> Cc: Mathias Nyman <[email protected]>
> Cc: Marcel Holtmann <[email protected]>
> Cc: Johan Hedberg <[email protected]>
> Cc: Luiz Augusto von Dentz <[email protected]>
> ---
> arch/alpha/kernel/srmcons.c | 2 +-
> arch/m68k/emu/nfcon.c | 2 +-
> arch/parisc/kernel/pdc_cons.c | 2 +-
> arch/um/drivers/line.c | 6 +++---
> arch/um/drivers/line.h | 2 +-
> arch/xtensa/platforms/iss/console.c | 2 +-
> drivers/char/pcmcia/synclink_cs.c | 2 +-
> drivers/char/ttyprintk.c | 2 +-
> drivers/ipack/devices/ipoctal.c | 2 +-
> drivers/isdn/capi/capi.c | 6 +++---
> drivers/misc/bcm-vk/bcm_vk_tty.c | 2 +-
> drivers/mmc/core/sdio_uart.c | 2 +-
> drivers/net/usb/hso.c | 4 ++--
> drivers/s390/char/con3215.c | 2 +-
> drivers/s390/char/sclp_tty.c | 4 ++--
> drivers/s390/char/sclp_vt220.c | 4 ++--
> drivers/s390/char/tty3270.c | 2 +-
> drivers/staging/fwserial/fwserial.c | 6 +++---
> drivers/staging/gdm724x/gdm_tty.c | 2 +-
> drivers/staging/greybus/uart.c | 2 +-
> drivers/tty/amiserial.c | 2 +-
> drivers/tty/ehv_bytechan.c | 4 ++--
> drivers/tty/goldfish.c | 2 +-
> drivers/tty/hvc/hvc_console.c | 2 +-
> drivers/tty/hvc/hvcs.c | 2 +-
> drivers/tty/hvc/hvsi.c | 4 ++--
> drivers/tty/ipwireless/tty.c | 2 +-
> drivers/tty/mips_ejtag_fdc.c | 4 ++--
> drivers/tty/moxa.c | 8 ++++----
> drivers/tty/mxser.c | 2 +-
> drivers/tty/n_gsm.c | 2 +-
> drivers/tty/nozomi.c | 4 ++--
> drivers/tty/pty.c | 2 +-
> drivers/tty/serial/kgdb_nmi.c | 2 +-
> drivers/tty/serial/serial_core.c | 4 ++--
> drivers/tty/synclink_gt.c | 6 +++---
> drivers/tty/tty_ioctl.c | 2 +-
> drivers/tty/ttynull.c | 2 +-
> drivers/tty/vcc.c | 4 ++--
> drivers/tty/vt/vt.c | 2 +-
> drivers/usb/class/cdc-acm.c | 2 +-
> drivers/usb/gadget/function/u_serial.c | 6 +++---
> drivers/usb/host/xhci-dbgtty.c | 4 ++--
> drivers/usb/serial/usb-serial.c | 2 +-
> include/linux/tty.h | 2 +-
> include/linux/tty_driver.h | 4 ++--
> net/bluetooth/rfcomm/tty.c | 2 +-
> 47 files changed, 71 insertions(+), 71 deletions(-)

. . .

Looks good.

Acked-by: Alex Elder <[email protected].

> diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c
> index b1e63f7798b0..529eccb99b6c 100644
> --- a/drivers/staging/greybus/uart.c
> +++ b/drivers/staging/greybus/uart.c
> @@ -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;

. . .