OSDN Git Service

tty: Convert ->carrier_raised() and callchains to bool
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 17 Jan 2023 09:03:52 +0000 (11:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2023 15:04:35 +0000 (16:04 +0100)
commitb300fb26c59a749bf49559932fa8a85eb916b5a7
treea1ce87cc01ec6b422bae9872729d00a5de833179
parentdcd794c6ed631b14b5dcfa5afb589ec4f7d0c411
tty: Convert ->carrier_raised() and callchains to bool

Return boolean from ->carrier_raised() instead of 0 and 1. Make the
return type change also to tty_port_carrier_raised() that makes the
->carrier_raised() call (+ cd variable in moxa into which its return
value is stored).

Also cleans up a few unnecessary constructs related to this change:

return xx ? 1 : 0;
-> return xx;

if (xx)
return 1;
return 0;
-> return xx;

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230117090358.4796-7-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 files changed:
drivers/char/pcmcia/synclink_cs.c
drivers/mmc/core/sdio_uart.c
drivers/tty/amiserial.c
drivers/tty/moxa.c
drivers/tty/mxser.c
drivers/tty/n_gsm.c
drivers/tty/serial/serial_core.c
drivers/tty/synclink_gt.c
drivers/tty/tty_port.c
drivers/usb/serial/usb-serial.c
include/linux/tty_port.h
net/bluetooth/rfcomm/tty.c