2023-01-11 14:50:00

by Ilpo Järvinen

[permalink] [raw]
Subject: [PATCH v3 00/13] tty/serial: bool conversions and cleanups

There are number of functions in tty/serial which have arguments or
return types that expect/behave like bool. Likely due to them existing
before bool was available, other types are used. Make conversions to
bool and cleanups.

v3:
- moxa: Fix function signature in comment
- moxa: Rearrange comment (0: off, 1: on) removal from rename change
to bool change (effect is internal to the series)

v2:
- Call dtr/rts parameters/variables consistently "active"
- Don't chain one return statement with ||
- Don't change function signatures to >80 chars ("while at it")
- moxa: differentiated dtr and status variables

Ilpo Järvinen (13):
tty: Cleanup tty_port_set_initialized() bool parameter
tty: Cleamup tty_port_set_suspended() bool parameter
tty: Cleanup tty_port_set_active() bool parameter
tty: moxa: Make local var storing tty_port_initialized() bool
serial: Convert uart_{,port_}startup() init_hw param to bool
tty: Convert ->carrier_raised() and callchains to bool
tty: Convert ->dtr_rts() to take bool argument
tty/serial: Make ->dcd_change()+uart_handle_dcd_change() status bool
active
serial: Make uart_handle_cts_change() status param bool active
tty: Return bool from tty_termios_hw_change()
tty/serial: Call ->dtr_rts() parameter active consistently
tty: moxa: Rename dtr/rts parameters/variables to active
usb/serial: Rename dtr/rts parameters/variables to active

drivers/char/pcmcia/synclink_cs.c | 18 +++---
drivers/ipack/devices/ipoctal.c | 4 +-
drivers/mmc/core/sdio_uart.c | 13 ++---
drivers/pps/clients/pps-ldisc.c | 6 +-
drivers/s390/char/con3215.c | 4 +-
drivers/staging/greybus/uart.c | 4 +-
drivers/tty/amiserial.c | 12 ++--
drivers/tty/hvc/hvc_console.c | 4 +-
drivers/tty/hvc/hvc_console.h | 2 +-
drivers/tty/hvc/hvc_iucv.c | 6 +-
drivers/tty/moxa.c | 82 ++++++++++++++--------------
drivers/tty/mxser.c | 11 ++--
drivers/tty/n_gsm.c | 16 +++---
drivers/tty/serial/imx.c | 2 +-
drivers/tty/serial/max3100.c | 2 +-
drivers/tty/serial/max310x.c | 3 +-
drivers/tty/serial/serial_core.c | 65 +++++++++++-----------
drivers/tty/serial/sunhv.c | 8 +--
drivers/tty/synclink_gt.c | 21 +++----
drivers/tty/tty_ioctl.c | 8 +--
drivers/tty/tty_port.c | 22 ++++----
drivers/usb/class/cdc-acm.c | 4 +-
drivers/usb/serial/ch341.c | 11 ++--
drivers/usb/serial/console.c | 2 +-
drivers/usb/serial/cp210x.c | 6 +-
drivers/usb/serial/cypress_m8.c | 6 +-
drivers/usb/serial/digi_acceleport.c | 6 +-
drivers/usb/serial/f81232.c | 10 ++--
drivers/usb/serial/f81534.c | 4 +-
drivers/usb/serial/ftdi_sio.c | 6 +-
drivers/usb/serial/generic.c | 10 ++--
drivers/usb/serial/ipw.c | 8 +--
drivers/usb/serial/keyspan.c | 6 +-
drivers/usb/serial/keyspan_pda.c | 4 +-
drivers/usb/serial/mct_u232.c | 6 +-
drivers/usb/serial/mxuport.c | 4 +-
drivers/usb/serial/pl2303.c | 11 ++--
drivers/usb/serial/quatech2.c | 6 +-
drivers/usb/serial/sierra.c | 6 +-
drivers/usb/serial/spcp8x5.c | 11 ++--
drivers/usb/serial/ssu100.c | 6 +-
drivers/usb/serial/upd78f0730.c | 8 +--
drivers/usb/serial/usb-serial.c | 8 +--
drivers/usb/serial/usb-wwan.h | 2 +-
drivers/usb/serial/usb_wwan.c | 6 +-
drivers/usb/serial/xr_serial.c | 8 +--
include/linux/serial_core.h | 6 +-
include/linux/tty.h | 2 +-
include/linux/tty_ldisc.h | 4 +-
include/linux/tty_port.h | 10 ++--
include/linux/usb/serial.h | 6 +-
net/bluetooth/rfcomm/tty.c | 2 +-
52 files changed, 248 insertions(+), 260 deletions(-)

--
2.30.2


2023-01-11 14:50:40

by Ilpo Järvinen

[permalink] [raw]
Subject: [PATCH v3 07/13] tty: Convert ->dtr_rts() to take bool argument

Convert the raise/on parameter in ->dtr_rts() to bool through the
callchain. The parameter is used like bool. In USB serial, there
remains a few implicit bool -> larger type conversions because some
devices use u8 in their control messages.

In moxa_tiocmget(), dtr variable was reused for line status which
requires int so use a separate variable for status.

Reviewed-by: Jiri Slaby <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
---
drivers/char/pcmcia/synclink_cs.c | 4 +--
drivers/mmc/core/sdio_uart.c | 4 +--
drivers/staging/greybus/uart.c | 2 +-
drivers/tty/amiserial.c | 2 +-
drivers/tty/hvc/hvc_console.c | 4 +--
drivers/tty/hvc/hvc_console.h | 2 +-
drivers/tty/hvc/hvc_iucv.c | 4 +--
drivers/tty/moxa.c | 54 ++++++++++++++--------------
drivers/tty/mxser.c | 2 +-
drivers/tty/n_gsm.c | 2 +-
drivers/tty/serial/serial_core.c | 8 ++---
drivers/tty/synclink_gt.c | 2 +-
drivers/tty/tty_port.c | 4 +--
drivers/usb/class/cdc-acm.c | 2 +-
drivers/usb/serial/ch341.c | 2 +-
drivers/usb/serial/cp210x.c | 4 +--
drivers/usb/serial/cypress_m8.c | 6 ++--
drivers/usb/serial/digi_acceleport.c | 6 ++--
drivers/usb/serial/f81232.c | 2 +-
drivers/usb/serial/f81534.c | 2 +-
drivers/usb/serial/ftdi_sio.c | 2 +-
drivers/usb/serial/ipw.c | 2 +-
drivers/usb/serial/keyspan.c | 2 +-
drivers/usb/serial/keyspan_pda.c | 2 +-
drivers/usb/serial/mct_u232.c | 4 +--
drivers/usb/serial/mxuport.c | 2 +-
drivers/usb/serial/pl2303.c | 2 +-
drivers/usb/serial/quatech2.c | 2 +-
drivers/usb/serial/sierra.c | 2 +-
drivers/usb/serial/spcp8x5.c | 2 +-
drivers/usb/serial/ssu100.c | 2 +-
drivers/usb/serial/upd78f0730.c | 6 ++--
drivers/usb/serial/usb-serial.c | 2 +-
drivers/usb/serial/usb-wwan.h | 2 +-
drivers/usb/serial/usb_wwan.c | 2 +-
drivers/usb/serial/xr_serial.c | 6 ++--
include/linux/tty_port.h | 4 +--
include/linux/usb/serial.h | 2 +-
38 files changed, 84 insertions(+), 82 deletions(-)

diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 4391138e1b8a..46a0b586d234 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -378,7 +378,7 @@ static void async_mode(MGSLPC_INFO *info);
static void tx_timeout(struct timer_list *t);

static bool carrier_raised(struct tty_port *port);
-static void dtr_rts(struct tty_port *port, int onoff);
+static void dtr_rts(struct tty_port *port, bool onoff);

#if SYNCLINK_GENERIC_HDLC
#define dev_to_port(D) (dev_to_hdlc(D)->priv)
@@ -2442,7 +2442,7 @@ static bool carrier_raised(struct tty_port *port)
return info->serial_signals & SerialSignal_DCD;
}

-static void dtr_rts(struct tty_port *port, int onoff)
+static void dtr_rts(struct tty_port *port, bool onoff)
{
MGSLPC_INFO *info = container_of(port, MGSLPC_INFO, port);
unsigned long flags;
diff --git a/drivers/mmc/core/sdio_uart.c b/drivers/mmc/core/sdio_uart.c
index 47f58258d8ff..c6b4b2b2a4b2 100644
--- a/drivers/mmc/core/sdio_uart.c
+++ b/drivers/mmc/core/sdio_uart.c
@@ -548,14 +548,14 @@ static bool uart_carrier_raised(struct tty_port *tport)
* adjusted during an open, close and hangup.
*/

-static void uart_dtr_rts(struct tty_port *tport, int onoff)
+static void uart_dtr_rts(struct tty_port *tport, bool onoff)
{
struct sdio_uart_port *port =
container_of(tport, struct sdio_uart_port, port);
int ret = sdio_uart_claim_func(port);
if (ret)
return;
- if (onoff == 0)
+ if (!onoff)
sdio_uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
else
sdio_uart_set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c
index 90ff07f2cbf7..92d49740d5a4 100644
--- a/drivers/staging/greybus/uart.c
+++ b/drivers/staging/greybus/uart.c
@@ -701,7 +701,7 @@ static int gb_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
return -ENOIOCTLCMD;
}

-static void gb_tty_dtr_rts(struct tty_port *port, int on)
+static void gb_tty_dtr_rts(struct tty_port *port, bool on)
{
struct gb_tty *gb_tty;
u8 newctrl;
diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
index 01c4fd3ce7c8..29d4c554f6b8 100644
--- a/drivers/tty/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -1459,7 +1459,7 @@ static bool amiga_carrier_raised(struct tty_port *port)
return !(ciab.pra & SER_DCD);
}

-static void amiga_dtr_rts(struct tty_port *port, int raise)
+static void amiga_dtr_rts(struct tty_port *port, bool raise)
{
struct serial_state *info = container_of(port, struct serial_state,
tport);
diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
index a683e21df19c..10c10cfdf92a 100644
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -376,7 +376,7 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
/* We are ready... raise DTR/RTS */
if (C_BAUD(tty))
if (hp->ops->dtr_rts)
- hp->ops->dtr_rts(hp, 1);
+ hp->ops->dtr_rts(hp, true);
tty_port_set_initialized(&hp->port, true);
}

@@ -406,7 +406,7 @@ static void hvc_close(struct tty_struct *tty, struct file * filp)

if (C_HUPCL(tty))
if (hp->ops->dtr_rts)
- hp->ops->dtr_rts(hp, 0);
+ hp->ops->dtr_rts(hp, false);

if (hp->ops->notifier_del)
hp->ops->notifier_del(hp, hp->data);
diff --git a/drivers/tty/hvc/hvc_console.h b/drivers/tty/hvc/hvc_console.h
index 18d005814e4b..6d3428bf868f 100644
--- a/drivers/tty/hvc/hvc_console.h
+++ b/drivers/tty/hvc/hvc_console.h
@@ -66,7 +66,7 @@ struct hv_ops {
int (*tiocmset)(struct hvc_struct *hp, unsigned int set, unsigned int clear);

/* Callbacks to handle tty ports */
- void (*dtr_rts)(struct hvc_struct *hp, int raise);
+ void (*dtr_rts)(struct hvc_struct *hp, bool raise);
};

/* Register a vterm and a slot index for use as a console (console_init) */
diff --git a/drivers/tty/hvc/hvc_iucv.c b/drivers/tty/hvc/hvc_iucv.c
index 7d49a872de48..fe862a6882d6 100644
--- a/drivers/tty/hvc/hvc_iucv.c
+++ b/drivers/tty/hvc/hvc_iucv.c
@@ -658,13 +658,13 @@ static void hvc_iucv_notifier_hangup(struct hvc_struct *hp, int id)
/**
* hvc_iucv_dtr_rts() - HVC notifier for handling DTR/RTS
* @hp: Pointer the HVC device (struct hvc_struct)
- * @raise: Non-zero to raise or zero to lower DTR/RTS lines
+ * @raise: True to raise or false to lower DTR/RTS lines
*
* This routine notifies the HVC back-end to raise or lower DTR/RTS
* lines. Raising DTR/RTS is ignored. Lowering DTR/RTS indicates to
* drop the IUCV connection (similar to hang up the modem).
*/
-static void hvc_iucv_dtr_rts(struct hvc_struct *hp, int raise)
+static void hvc_iucv_dtr_rts(struct hvc_struct *hp, bool raise)
{
struct hvc_iucv_private *priv;
struct iucv_path *path;
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
index 6a1e78e33a2c..9be3d585d5a9 100644
--- a/drivers/tty/moxa.c
+++ b/drivers/tty/moxa.c
@@ -502,15 +502,15 @@ static void moxa_poll(struct timer_list *);
static void moxa_set_tty_param(struct tty_struct *, const struct ktermios *);
static void moxa_shutdown(struct tty_port *);
static bool moxa_carrier_raised(struct tty_port *);
-static void moxa_dtr_rts(struct tty_port *, int);
+static void moxa_dtr_rts(struct tty_port *, bool);
/*
* moxa board interface functions:
*/
static void MoxaPortEnable(struct moxa_port *);
static void MoxaPortDisable(struct moxa_port *);
static int MoxaPortSetTermio(struct moxa_port *, struct ktermios *, speed_t);
-static int MoxaPortGetLineOut(struct moxa_port *, int *, int *);
-static void MoxaPortLineCtrl(struct moxa_port *, int, int);
+static int MoxaPortGetLineOut(struct moxa_port *, bool *, bool *);
+static void MoxaPortLineCtrl(struct moxa_port *, bool, bool);
static void MoxaPortFlowCtrl(struct moxa_port *, int, int, int, int, int);
static int MoxaPortLineStatus(struct moxa_port *);
static void MoxaPortFlushData(struct moxa_port *, int);
@@ -1443,7 +1443,7 @@ static bool moxa_carrier_raised(struct tty_port *port)
return dcd;
}

-static void moxa_dtr_rts(struct tty_port *port, int onoff)
+static void moxa_dtr_rts(struct tty_port *port, bool onoff)
{
struct moxa_port *ch = container_of(port, struct moxa_port, port);
MoxaPortLineCtrl(ch, onoff, onoff);
@@ -1481,7 +1481,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
if (!tty_port_initialized(&ch->port)) {
ch->statusflags = 0;
moxa_set_tty_param(tty, &tty->termios);
- MoxaPortLineCtrl(ch, 1, 1);
+ MoxaPortLineCtrl(ch, true, true);
MoxaPortEnable(ch);
MoxaSetFifo(ch, ch->type == PORT_16550A);
tty_port_set_initialized(&ch->port, true);
@@ -1557,19 +1557,21 @@ static unsigned int moxa_chars_in_buffer(struct tty_struct *tty)
static int moxa_tiocmget(struct tty_struct *tty)
{
struct moxa_port *ch = tty->driver_data;
- int flag = 0, dtr, rts;
+ bool dtr, rts;
+ int flag = 0;
+ int status;

MoxaPortGetLineOut(ch, &dtr, &rts);
if (dtr)
flag |= TIOCM_DTR;
if (rts)
flag |= TIOCM_RTS;
- dtr = MoxaPortLineStatus(ch);
- if (dtr & 1)
+ status = MoxaPortLineStatus(ch);
+ if (status & 1)
flag |= TIOCM_CTS;
- if (dtr & 2)
+ if (status & 2)
flag |= TIOCM_DSR;
- if (dtr & 4)
+ if (status & 4)
flag |= TIOCM_CD;
return flag;
}
@@ -1578,7 +1580,7 @@ static int moxa_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{
struct moxa_port *ch;
- int dtr, rts;
+ bool dtr, rts;

mutex_lock(&moxa_openlock);
ch = tty->driver_data;
@@ -1589,13 +1591,13 @@ static int moxa_tiocmset(struct tty_struct *tty,

MoxaPortGetLineOut(ch, &dtr, &rts);
if (set & TIOCM_RTS)
- rts = 1;
+ rts = true;
if (set & TIOCM_DTR)
- dtr = 1;
+ dtr = true;
if (clear & TIOCM_RTS)
- rts = 0;
+ rts = false;
if (clear & TIOCM_DTR)
- dtr = 0;
+ dtr = false;
MoxaPortLineCtrl(ch, dtr, rts);
mutex_unlock(&moxa_openlock);
return 0;
@@ -1877,12 +1879,12 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode)
*
* Function 13: Get the DTR/RTS state of this port.
* Syntax:
- * int MoxaPortGetLineOut(int port, int *dtrState, int *rtsState);
+ * int MoxaPortGetLineOut(int port, bool *dtrState, bool *rtsState);
* int port : port number (0 - 127)
- * int * dtrState : pointer to INT to receive the current DTR
+ * bool * dtrState : pointer to bool to receive the current DTR
* state. (if NULL, this function will not
* write to this address)
- * int * rtsState : pointer to INT to receive the current RTS
+ * bool * rtsState : pointer to bool to receive the current RTS
* state. (if NULL, this function will not
* write to this address)
*
@@ -1892,10 +1894,10 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode)
*
* Function 14: Setting the DTR/RTS output state of this port.
* Syntax:
- * void MoxaPortLineCtrl(int port, int dtrState, int rtsState);
+ * void MoxaPortLineCtrl(int port, bool dtrState, bool rtsState);
* int port : port number (0 - 127)
- * int dtrState : DTR output state (0: off, 1: on)
- * int rtsState : RTS output state (0: off, 1: on)
+ * bool dtrState : DTR output state
+ * bool rtsState : RTS output state
*
*
* Function 15: Setting the flow control of this port.
@@ -2103,18 +2105,18 @@ static int MoxaPortSetTermio(struct moxa_port *port, struct ktermios *termio,
return baud;
}

-static int MoxaPortGetLineOut(struct moxa_port *port, int *dtrState,
- int *rtsState)
+static int MoxaPortGetLineOut(struct moxa_port *port, bool *dtrState,
+ bool *rtsState)
{
if (dtrState)
- *dtrState = !!(port->lineCtrl & DTR_ON);
+ *dtrState = port->lineCtrl & DTR_ON;
if (rtsState)
- *rtsState = !!(port->lineCtrl & RTS_ON);
+ *rtsState = port->lineCtrl & RTS_ON;

return 0;
}

-static void MoxaPortLineCtrl(struct moxa_port *port, int dtr, int rts)
+static void MoxaPortLineCtrl(struct moxa_port *port, bool dtr, bool rts)
{
u8 mode = 0;

diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 96c72e691cd7..d4fb11e39bb1 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -465,7 +465,7 @@ static bool mxser_carrier_raised(struct tty_port *port)
return inb(mp->ioaddr + UART_MSR) & UART_MSR_DCD;
}

-static void mxser_dtr_rts(struct tty_port *port, int on)
+static void mxser_dtr_rts(struct tty_port *port, bool on)
{
struct mxser_port *mp = container_of(port, struct mxser_port, port);
unsigned long flags;
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 81fc2ec3693f..8dd0d6441c42 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -3792,7 +3792,7 @@ static bool gsm_carrier_raised(struct tty_port *port)
return dlci->modem_rx & TIOCM_CD;
}

-static void gsm_dtr_rts(struct tty_port *port, int onoff)
+static void gsm_dtr_rts(struct tty_port *port, bool onoff)
{
struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port);
unsigned int modem_tx = dlci->modem_tx;
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 20ed8a088b2d..053535846ba2 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -169,7 +169,7 @@ uart_update_mctrl(struct uart_port *port, unsigned int set, unsigned int clear)
#define uart_set_mctrl(port, set) uart_update_mctrl(port, set, 0)
#define uart_clear_mctrl(port, clear) uart_update_mctrl(port, 0, clear)

-static void uart_port_dtr_rts(struct uart_port *uport, int raise)
+static void uart_port_dtr_rts(struct uart_port *uport, bool raise)
{
if (raise)
uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
@@ -239,7 +239,7 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
* port is open and ready to respond.
*/
if (init_hw && C_BAUD(tty))
- uart_port_dtr_rts(uport, 1);
+ uart_port_dtr_rts(uport, true);
}

/*
@@ -302,7 +302,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)
}

if (!tty || C_HUPCL(tty))
- uart_port_dtr_rts(uport, 0);
+ uart_port_dtr_rts(uport, false);

uart_port_shutdown(port);
}
@@ -1885,7 +1885,7 @@ static bool uart_carrier_raised(struct tty_port *port)
return mctrl & TIOCM_CAR;
}

-static void uart_dtr_rts(struct tty_port *port, int raise)
+static void uart_dtr_rts(struct tty_port *port, bool raise)
{
struct uart_state *state = container_of(port, struct uart_state, port);
struct uart_port *uport;
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
index 4ba71ec764f7..2b786265ce7b 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -3138,7 +3138,7 @@ static bool carrier_raised(struct tty_port *port)
return info->signals & SerialSignal_DCD;
}

-static void dtr_rts(struct tty_port *port, int on)
+static void dtr_rts(struct tty_port *port, bool on)
{
unsigned long flags;
struct slgt_info *info = container_of(port, struct slgt_info, port);
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index a573c500f95b..a788a6bf487d 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -463,7 +463,7 @@ EXPORT_SYMBOL(tty_port_carrier_raised);
void tty_port_raise_dtr_rts(struct tty_port *port)
{
if (port->ops->dtr_rts)
- port->ops->dtr_rts(port, 1);
+ port->ops->dtr_rts(port, true);
}
EXPORT_SYMBOL(tty_port_raise_dtr_rts);

@@ -478,7 +478,7 @@ EXPORT_SYMBOL(tty_port_raise_dtr_rts);
void tty_port_lower_dtr_rts(struct tty_port *port)
{
if (port->ops->dtr_rts)
- port->ops->dtr_rts(port, 0);
+ port->ops->dtr_rts(port, false);
}
EXPORT_SYMBOL(tty_port_lower_dtr_rts);

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 36bf051b345b..d4f9220b8162 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -651,7 +651,7 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
return tty_port_open(&acm->port, tty, filp);
}

-static void acm_port_dtr_rts(struct tty_port *port, int raise)
+static void acm_port_dtr_rts(struct tty_port *port, bool raise)
{
struct acm *acm = container_of(port, struct acm, port);
int val;
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index 792f01a4ed22..98ec4fe46914 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -420,7 +420,7 @@ static bool ch341_carrier_raised(struct usb_serial_port *port)
return priv->msr & CH341_BIT_DCD;
}

-static void ch341_dtr_rts(struct usb_serial_port *port, int on)
+static void ch341_dtr_rts(struct usb_serial_port *port, bool on)
{
struct ch341_private *priv = usb_get_serial_port_data(port);
unsigned long flags;
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 67372acc2352..fe2cdc477fb9 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -45,7 +45,7 @@ static void cp210x_disconnect(struct usb_serial *);
static void cp210x_release(struct usb_serial *);
static int cp210x_port_probe(struct usb_serial_port *);
static void cp210x_port_remove(struct usb_serial_port *);
-static void cp210x_dtr_rts(struct usb_serial_port *port, int on);
+static void cp210x_dtr_rts(struct usb_serial_port *port, bool on);
static void cp210x_process_read_urb(struct urb *urb);
static void cp210x_enable_event_mode(struct usb_serial_port *port);
static void cp210x_disable_event_mode(struct usb_serial_port *port);
@@ -1402,7 +1402,7 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port,
return ret;
}

-static void cp210x_dtr_rts(struct usb_serial_port *port, int on)
+static void cp210x_dtr_rts(struct usb_serial_port *port, bool on)
{
if (on)
cp210x_tiocmset_port(port, TIOCM_DTR | TIOCM_RTS, 0);
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 1e0c028c5ec9..7c6060c17ee0 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -118,7 +118,7 @@ static int cypress_ca42v2_port_probe(struct usb_serial_port *port);
static void cypress_port_remove(struct usb_serial_port *port);
static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port);
static void cypress_close(struct usb_serial_port *port);
-static void cypress_dtr_rts(struct usb_serial_port *port, int on);
+static void cypress_dtr_rts(struct usb_serial_port *port, bool on);
static int cypress_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *buf, int count);
static void cypress_send(struct usb_serial_port *port);
@@ -621,12 +621,12 @@ static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port)
return result;
} /* cypress_open */

-static void cypress_dtr_rts(struct usb_serial_port *port, int on)
+static void cypress_dtr_rts(struct usb_serial_port *port, bool on)
{
struct cypress_private *priv = usb_get_serial_port_data(port);
/* drop dtr and rts */
spin_lock_irq(&priv->lock);
- if (on == 0)
+ if (!on)
priv->line_control = 0;
else
priv->line_control = CONTROL_DTR | CONTROL_RTS;
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 45d688e9b93f..890e446273d7 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -228,7 +228,7 @@ static unsigned int digi_write_room(struct tty_struct *tty);
static unsigned int digi_chars_in_buffer(struct tty_struct *tty);
static int digi_open(struct tty_struct *tty, struct usb_serial_port *port);
static void digi_close(struct usb_serial_port *port);
-static void digi_dtr_rts(struct usb_serial_port *port, int on);
+static void digi_dtr_rts(struct usb_serial_port *port, bool on);
static int digi_startup_device(struct usb_serial *serial);
static int digi_startup(struct usb_serial *serial);
static void digi_disconnect(struct usb_serial *serial);
@@ -1060,10 +1060,10 @@ static unsigned int digi_chars_in_buffer(struct tty_struct *tty)
return chars;
}

-static void digi_dtr_rts(struct usb_serial_port *port, int on)
+static void digi_dtr_rts(struct usb_serial_port *port, bool on)
{
/* Adjust DTR and RTS */
- digi_set_modem_signals(port, on * (TIOCM_DTR | TIOCM_RTS), 1);
+ digi_set_modem_signals(port, on ? (TIOCM_DTR | TIOCM_RTS) : 0, 1);
}

static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
index 1a8c2925c26f..1656be847460 100644
--- a/drivers/usb/serial/f81232.c
+++ b/drivers/usb/serial/f81232.c
@@ -752,7 +752,7 @@ static void f81232_close(struct usb_serial_port *port)
flush_work(&port_priv->lsr_work);
}

-static void f81232_dtr_rts(struct usb_serial_port *port, int on)
+static void f81232_dtr_rts(struct usb_serial_port *port, bool on)
{
if (on)
f81232_set_mctrl(port, TIOCM_DTR | TIOCM_RTS, 0);
diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c
index 4083ae961be4..8b44b08752d6 100644
--- a/drivers/usb/serial/f81534.c
+++ b/drivers/usb/serial/f81534.c
@@ -1456,7 +1456,7 @@ static int f81534_tiocmset(struct tty_struct *tty, unsigned int set,
return f81534_update_mctrl(port, set, clear);
}

-static void f81534_dtr_rts(struct usb_serial_port *port, int on)
+static void f81534_dtr_rts(struct usb_serial_port *port, bool on)
{
if (on)
f81534_update_mctrl(port, TIOCM_DTR | TIOCM_RTS, 0);
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 05e28a5ce42b..09bdf623e94e 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2366,7 +2366,7 @@ static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
return usb_serial_generic_open(tty, port);
}

-static void ftdi_dtr_rts(struct usb_serial_port *port, int on)
+static void ftdi_dtr_rts(struct usb_serial_port *port, bool on)
{
struct ftdi_private *priv = usb_get_serial_port_data(port);

diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
index d04c7cc5c1c2..b1b7a033cc75 100644
--- a/drivers/usb/serial/ipw.c
+++ b/drivers/usb/serial/ipw.c
@@ -215,7 +215,7 @@ static void ipw_release(struct usb_serial *serial)
kfree(data);
}

-static void ipw_dtr_rts(struct usb_serial_port *port, int on)
+static void ipw_dtr_rts(struct usb_serial_port *port, bool on)
{
struct usb_device *udev = port->serial->dev;
struct device *dev = &port->dev;
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 2966e0c4941e..7e375367354b 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -1564,7 +1564,7 @@ static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port)
return 0;
}

-static void keyspan_dtr_rts(struct usb_serial_port *port, int on)
+static void keyspan_dtr_rts(struct usb_serial_port *port, bool on)
{
struct keyspan_port_private *p_priv = usb_get_serial_port_data(port);

diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index 6fd15cd9e1eb..cb16c4bc8555 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -551,7 +551,7 @@ static int keyspan_pda_write(struct tty_struct *tty, struct usb_serial_port *por
return count;
}

-static void keyspan_pda_dtr_rts(struct usb_serial_port *port, int on)
+static void keyspan_pda_dtr_rts(struct usb_serial_port *port, bool on)
{
struct usb_serial *serial = port->serial;

diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index d3852feb81a4..eb3520490dd2 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -42,7 +42,7 @@ static int mct_u232_port_probe(struct usb_serial_port *port);
static void mct_u232_port_remove(struct usb_serial_port *remove);
static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port);
static void mct_u232_close(struct usb_serial_port *port);
-static void mct_u232_dtr_rts(struct usb_serial_port *port, int on);
+static void mct_u232_dtr_rts(struct usb_serial_port *port, bool on);
static void mct_u232_read_int_callback(struct urb *urb);
static void mct_u232_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
@@ -477,7 +477,7 @@ static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port)
return retval;
} /* mct_u232_open */

-static void mct_u232_dtr_rts(struct usb_serial_port *port, int on)
+static void mct_u232_dtr_rts(struct usb_serial_port *port, bool on)
{
unsigned int control_state;
struct mct_u232_private *priv = usb_get_serial_port_data(port);
diff --git a/drivers/usb/serial/mxuport.c b/drivers/usb/serial/mxuport.c
index faa0eedfe245..ac7594635719 100644
--- a/drivers/usb/serial/mxuport.c
+++ b/drivers/usb/serial/mxuport.c
@@ -674,7 +674,7 @@ static int mxuport_set_rts(struct usb_serial_port *port, u8 state)
return err;
}

-static void mxuport_dtr_rts(struct usb_serial_port *port, int on)
+static void mxuport_dtr_rts(struct usb_serial_port *port, bool on)
{
struct mxuport_port *mxport = usb_get_serial_port_data(port);
u8 mcr_state;
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 4cb81746a149..cb20911f35bb 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -931,7 +931,7 @@ static void pl2303_set_termios(struct tty_struct *tty,
kfree(buf);
}

-static void pl2303_dtr_rts(struct usb_serial_port *port, int on)
+static void pl2303_dtr_rts(struct usb_serial_port *port, bool on)
{
struct pl2303_private *priv = usb_get_serial_port_data(port);
unsigned long flags;
diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c
index 6fca40ace83a..6fd329ffec7e 100644
--- a/drivers/usb/serial/quatech2.c
+++ b/drivers/usb/serial/quatech2.c
@@ -770,7 +770,7 @@ static void qt2_break_ctl(struct tty_struct *tty, int break_state)



-static void qt2_dtr_rts(struct usb_serial_port *port, int on)
+static void qt2_dtr_rts(struct usb_serial_port *port, bool on)
{
struct usb_device *dev = port->serial->dev;
struct qt2_port_private *port_priv = usb_get_serial_port_data(port);
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 353b2549eaa8..f2c3a7af1a4a 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -813,7 +813,7 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)
}


-static void sierra_dtr_rts(struct usb_serial_port *port, int on)
+static void sierra_dtr_rts(struct usb_serial_port *port, bool on)
{
struct sierra_port_private *portdata;

diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
index 8175db6c4554..02402ea3bd1b 100644
--- a/drivers/usb/serial/spcp8x5.c
+++ b/drivers/usb/serial/spcp8x5.c
@@ -256,7 +256,7 @@ static bool spcp8x5_carrier_raised(struct usb_serial_port *port)
return ret || msr & MSR_STATUS_LINE_DCD;
}

-static void spcp8x5_dtr_rts(struct usb_serial_port *port, int on)
+static void spcp8x5_dtr_rts(struct usb_serial_port *port, bool on)
{
struct spcp8x5_private *priv = usb_get_serial_port_data(port);
unsigned long flags;
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
index 1e1888b66305..4cff39895804 100644
--- a/drivers/usb/serial/ssu100.c
+++ b/drivers/usb/serial/ssu100.c
@@ -385,7 +385,7 @@ static int ssu100_tiocmset(struct tty_struct *tty,
return update_mctrl(dev, set, clear);
}

-static void ssu100_dtr_rts(struct usb_serial_port *port, int on)
+static void ssu100_dtr_rts(struct usb_serial_port *port, bool on)
{
struct usb_device *dev = port->serial->dev;

diff --git a/drivers/usb/serial/upd78f0730.c b/drivers/usb/serial/upd78f0730.c
index c47439bd90fa..206749fe3263 100644
--- a/drivers/usb/serial/upd78f0730.c
+++ b/drivers/usb/serial/upd78f0730.c
@@ -262,7 +262,7 @@ static void upd78f0730_break_ctl(struct tty_struct *tty, int break_state)
mutex_unlock(&private->lock);
}

-static void upd78f0730_dtr_rts(struct usb_serial_port *port, int on)
+static void upd78f0730_dtr_rts(struct usb_serial_port *port, bool on)
{
struct tty_struct *tty = port->port.tty;
unsigned int set = 0;
@@ -307,9 +307,9 @@ static void upd78f0730_set_termios(struct tty_struct *tty,
return;

if (C_BAUD(tty) == B0)
- upd78f0730_dtr_rts(port, 0);
+ upd78f0730_dtr_rts(port, false);
else if (old_termios && (old_termios->c_cflag & CBAUD) == B0)
- upd78f0730_dtr_rts(port, 1);
+ upd78f0730_dtr_rts(port, true);

baud_rate = upd78f0730_get_baud_rate(tty);
request.opcode = UPD78F0730_CMD_LINE_CONTROL;
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 019720a63fac..f8404073558b 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -765,7 +765,7 @@ static bool serial_port_carrier_raised(struct tty_port *port)
return true;
}

-static void serial_port_dtr_rts(struct tty_port *port, int on)
+static void serial_port_dtr_rts(struct tty_port *port, bool on)
{
struct usb_serial_port *p = container_of(port, struct usb_serial_port, port);
struct usb_serial_driver *drv = p->serial->type;
diff --git a/drivers/usb/serial/usb-wwan.h b/drivers/usb/serial/usb-wwan.h
index 519101945769..b2a07dd44225 100644
--- a/drivers/usb/serial/usb-wwan.h
+++ b/drivers/usb/serial/usb-wwan.h
@@ -6,7 +6,7 @@
#ifndef __LINUX_USB_USB_WWAN
#define __LINUX_USB_USB_WWAN

-extern void usb_wwan_dtr_rts(struct usb_serial_port *port, int on);
+extern void usb_wwan_dtr_rts(struct usb_serial_port *port, bool on);
extern int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port);
extern void usb_wwan_close(struct usb_serial_port *port);
extern int usb_wwan_port_probe(struct usb_serial_port *port);
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index 0017f6e969e1..168b11cc02b6 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -69,7 +69,7 @@ static int usb_wwan_send_setup(struct usb_serial_port *port)
return res;
}

-void usb_wwan_dtr_rts(struct usb_serial_port *port, int on)
+void usb_wwan_dtr_rts(struct usb_serial_port *port, bool on)
{
struct usb_wwan_port_private *portdata;
struct usb_wwan_intf_private *intfdata;
diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c
index fdb0aae546c3..9aaed09d45e4 100644
--- a/drivers/usb/serial/xr_serial.c
+++ b/drivers/usb/serial/xr_serial.c
@@ -495,7 +495,7 @@ static int xr_tiocmset(struct tty_struct *tty,
return xr_tiocmset_port(port, set, clear);
}

-static void xr_dtr_rts(struct usb_serial_port *port, int on)
+static void xr_dtr_rts(struct usb_serial_port *port, bool on)
{
if (on)
xr_tiocmset_port(port, TIOCM_DTR | TIOCM_RTS, 0);
@@ -669,9 +669,9 @@ static void xr_set_flow_mode(struct tty_struct *tty,
xr_uart_enable(port);

if (C_BAUD(tty) == B0)
- xr_dtr_rts(port, 0);
+ xr_dtr_rts(port, false);
else if (old_termios && (old_termios->c_cflag & CBAUD) == B0)
- xr_dtr_rts(port, 1);
+ xr_dtr_rts(port, true);
}

static void xr21v141x_set_line_settings(struct tty_struct *tty,
diff --git a/include/linux/tty_port.h b/include/linux/tty_port.h
index cf098459cb01..c44e489de0ff 100644
--- a/include/linux/tty_port.h
+++ b/include/linux/tty_port.h
@@ -16,7 +16,7 @@ struct tty_struct;
/**
* struct tty_port_operations -- operations on tty_port
* @carrier_raised: return true if the carrier is raised on @port
- * @dtr_rts: raise the DTR line if @raise is nonzero, otherwise lower DTR
+ * @dtr_rts: raise the DTR line if @raise is true, otherwise lower DTR
* @shutdown: called when the last close completes or a hangup finishes IFF the
* port was initialized. Do not use to free resources. Turn off the device
* only. Called under the port mutex to serialize against @activate and
@@ -32,7 +32,7 @@ struct tty_struct;
*/
struct tty_port_operations {
bool (*carrier_raised)(struct tty_port *port);
- void (*dtr_rts)(struct tty_port *port, int raise);
+ void (*dtr_rts)(struct tty_port *port, bool raise);
void (*shutdown)(struct tty_port *port);
int (*activate)(struct tty_port *port, struct tty_struct *tty);
void (*destruct)(struct tty_port *port);
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index dc7f90522b42..c597357853d9 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -292,7 +292,7 @@ struct usb_serial_driver {
struct serial_icounter_struct *icount);
/* Called by the tty layer for port level work. There may or may not
be an attached tty at this point */
- void (*dtr_rts)(struct usb_serial_port *port, int on);
+ void (*dtr_rts)(struct usb_serial_port *port, bool on);
bool (*carrier_raised)(struct usb_serial_port *port);
/* Called by the usb serial hooks to allow the user to rework the
termios state */
--
2.30.2

2023-01-11 14:50:49

by Ilpo Järvinen

[permalink] [raw]
Subject: [PATCH v3 02/13] tty: Cleamup tty_port_set_suspended() bool parameter

Make callers pass true/false consistently for bool val.

Reviewed-by: Jiri Slaby <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
---
drivers/tty/serial/serial_core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index e049c760b738..f9564b1e3dfb 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -312,7 +312,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)
* a DCD drop (hangup) at just the right time. Clear suspended bit so
* we don't try to resume a port that has been shutdown.
*/
- tty_port_set_suspended(port, 0);
+ tty_port_set_suspended(port, false);

/*
* Do not free() the transmit buffer page under the port lock since
@@ -1725,7 +1725,7 @@ static void uart_tty_port_shutdown(struct tty_port *port)
* a DCD drop (hangup) at just the right time. Clear suspended bit so
* we don't try to resume a port that has been shutdown.
*/
- tty_port_set_suspended(port, 0);
+ tty_port_set_suspended(port, false);

/*
* Free the transmit buffer.
@@ -2346,7 +2346,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
int tries;
unsigned int mctrl;

- tty_port_set_suspended(port, 1);
+ tty_port_set_suspended(port, true);
tty_port_set_initialized(port, false);

spin_lock_irq(&uport->lock);
@@ -2469,7 +2469,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
}
}

- tty_port_set_suspended(port, 0);
+ tty_port_set_suspended(port, false);
}

mutex_unlock(&port->mutex);
--
2.30.2

2023-01-11 14:58:14

by Ilpo Järvinen

[permalink] [raw]
Subject: [PATCH v3 10/13] tty: Return bool from tty_termios_hw_change()

Change tty_termios_hw_change() to return bool.

Reviewed-by: Jiri Slaby <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
---
drivers/tty/tty_ioctl.c | 8 ++++----
include/linux/tty.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
index ce511557b98b..12983ce4e43e 100644
--- a/drivers/tty/tty_ioctl.c
+++ b/drivers/tty/tty_ioctl.c
@@ -270,13 +270,13 @@ EXPORT_SYMBOL(tty_termios_copy_hw);
* between the two termios structures, or a speed change is needed.
*/

-int tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b)
+bool tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b)
{
if (a->c_ispeed != b->c_ispeed || a->c_ospeed != b->c_ospeed)
- return 1;
+ return true;
if ((a->c_cflag ^ b->c_cflag) & ~(HUPCL | CREAD | CLOCAL))
- return 1;
- return 0;
+ return true;
+ return false;
}
EXPORT_SYMBOL(tty_termios_hw_change);

diff --git a/include/linux/tty.h b/include/linux/tty.h
index 730c3301d710..093935e97f42 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -453,7 +453,7 @@ unsigned char tty_get_char_size(unsigned int cflag);
unsigned char tty_get_frame_size(unsigned int cflag);

void tty_termios_copy_hw(struct ktermios *new, const struct ktermios *old);
-int tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b);
+bool tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b);
int tty_set_termios(struct tty_struct *tty, struct ktermios *kt);

void tty_wakeup(struct tty_struct *tty);
--
2.30.2

2023-01-11 14:58:24

by Ilpo Järvinen

[permalink] [raw]
Subject: [PATCH v3 13/13] usb/serial: Rename dtr/rts parameters/variables to active

Use active consistently for naming parameters and variables.
This converts all USB serial drivers + CDC-ACM.

Signed-off-by: Ilpo Järvinen <[email protected]>
---
drivers/usb/class/cdc-acm.c | 4 ++--
drivers/usb/serial/ch341.c | 4 ++--
drivers/usb/serial/cp210x.c | 6 +++---
drivers/usb/serial/cypress_m8.c | 6 +++---
drivers/usb/serial/digi_acceleport.c | 6 +++---
drivers/usb/serial/f81232.c | 4 ++--
drivers/usb/serial/f81534.c | 4 ++--
drivers/usb/serial/ftdi_sio.c | 6 +++---
drivers/usb/serial/ipw.c | 8 ++++----
drivers/usb/serial/keyspan.c | 6 +++---
drivers/usb/serial/keyspan_pda.c | 4 ++--
drivers/usb/serial/mct_u232.c | 6 +++---
drivers/usb/serial/mxuport.c | 4 ++--
drivers/usb/serial/pl2303.c | 4 ++--
drivers/usb/serial/quatech2.c | 6 +++---
drivers/usb/serial/sierra.c | 6 +++---
drivers/usb/serial/spcp8x5.c | 4 ++--
drivers/usb/serial/ssu100.c | 6 +++---
drivers/usb/serial/upd78f0730.c | 4 ++--
drivers/usb/serial/usb-serial.c | 4 ++--
drivers/usb/serial/usb-wwan.h | 2 +-
drivers/usb/serial/usb_wwan.c | 6 +++---
drivers/usb/serial/xr_serial.c | 4 ++--
23 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index d4f9220b8162..11da5fb284d0 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -651,13 +651,13 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
return tty_port_open(&acm->port, tty, filp);
}

-static void acm_port_dtr_rts(struct tty_port *port, bool raise)
+static void acm_port_dtr_rts(struct tty_port *port, bool active)
{
struct acm *acm = container_of(port, struct acm, port);
int val;
int res;

- if (raise)
+ if (active)
val = USB_CDC_CTRL_DTR | USB_CDC_CTRL_RTS;
else
val = 0;
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index 98ec4fe46914..68e2eddde911 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -420,14 +420,14 @@ static bool ch341_carrier_raised(struct usb_serial_port *port)
return priv->msr & CH341_BIT_DCD;
}

-static void ch341_dtr_rts(struct usb_serial_port *port, bool on)
+static void ch341_dtr_rts(struct usb_serial_port *port, bool active)
{
struct ch341_private *priv = usb_get_serial_port_data(port);
unsigned long flags;

/* drop DTR and RTS */
spin_lock_irqsave(&priv->lock, flags);
- if (on)
+ if (active)
priv->mcr |= CH341_BIT_RTS | CH341_BIT_DTR;
else
priv->mcr &= ~(CH341_BIT_RTS | CH341_BIT_DTR);
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index fe2cdc477fb9..c5c80492ad98 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -45,7 +45,7 @@ static void cp210x_disconnect(struct usb_serial *);
static void cp210x_release(struct usb_serial *);
static int cp210x_port_probe(struct usb_serial_port *);
static void cp210x_port_remove(struct usb_serial_port *);
-static void cp210x_dtr_rts(struct usb_serial_port *port, bool on);
+static void cp210x_dtr_rts(struct usb_serial_port *port, bool active);
static void cp210x_process_read_urb(struct urb *urb);
static void cp210x_enable_event_mode(struct usb_serial_port *port);
static void cp210x_disable_event_mode(struct usb_serial_port *port);
@@ -1402,9 +1402,9 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port,
return ret;
}

-static void cp210x_dtr_rts(struct usb_serial_port *port, bool on)
+static void cp210x_dtr_rts(struct usb_serial_port *port, bool active)
{
- if (on)
+ if (active)
cp210x_tiocmset_port(port, TIOCM_DTR | TIOCM_RTS, 0);
else
cp210x_tiocmset_port(port, 0, TIOCM_DTR | TIOCM_RTS);
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 7c6060c17ee0..5167cf6dd99c 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -118,7 +118,7 @@ static int cypress_ca42v2_port_probe(struct usb_serial_port *port);
static void cypress_port_remove(struct usb_serial_port *port);
static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port);
static void cypress_close(struct usb_serial_port *port);
-static void cypress_dtr_rts(struct usb_serial_port *port, bool on);
+static void cypress_dtr_rts(struct usb_serial_port *port, bool active);
static int cypress_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *buf, int count);
static void cypress_send(struct usb_serial_port *port);
@@ -621,12 +621,12 @@ static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port)
return result;
} /* cypress_open */

-static void cypress_dtr_rts(struct usb_serial_port *port, bool on)
+static void cypress_dtr_rts(struct usb_serial_port *port, bool active)
{
struct cypress_private *priv = usb_get_serial_port_data(port);
/* drop dtr and rts */
spin_lock_irq(&priv->lock);
- if (!on)
+ if (!active)
priv->line_control = 0;
else
priv->line_control = CONTROL_DTR | CONTROL_RTS;
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 890e446273d7..82529c1939ca 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -228,7 +228,7 @@ static unsigned int digi_write_room(struct tty_struct *tty);
static unsigned int digi_chars_in_buffer(struct tty_struct *tty);
static int digi_open(struct tty_struct *tty, struct usb_serial_port *port);
static void digi_close(struct usb_serial_port *port);
-static void digi_dtr_rts(struct usb_serial_port *port, bool on);
+static void digi_dtr_rts(struct usb_serial_port *port, bool active);
static int digi_startup_device(struct usb_serial *serial);
static int digi_startup(struct usb_serial *serial);
static void digi_disconnect(struct usb_serial *serial);
@@ -1060,10 +1060,10 @@ static unsigned int digi_chars_in_buffer(struct tty_struct *tty)
return chars;
}

-static void digi_dtr_rts(struct usb_serial_port *port, bool on)
+static void digi_dtr_rts(struct usb_serial_port *port, bool active)
{
/* Adjust DTR and RTS */
- digi_set_modem_signals(port, on ? (TIOCM_DTR | TIOCM_RTS) : 0, 1);
+ digi_set_modem_signals(port, active ? (TIOCM_DTR | TIOCM_RTS) : 0, 1);
}

static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
index 1656be847460..ca5ff47417a9 100644
--- a/drivers/usb/serial/f81232.c
+++ b/drivers/usb/serial/f81232.c
@@ -752,9 +752,9 @@ static void f81232_close(struct usb_serial_port *port)
flush_work(&port_priv->lsr_work);
}

-static void f81232_dtr_rts(struct usb_serial_port *port, bool on)
+static void f81232_dtr_rts(struct usb_serial_port *port, bool active)
{
- if (on)
+ if (active)
f81232_set_mctrl(port, TIOCM_DTR | TIOCM_RTS, 0);
else
f81232_set_mctrl(port, 0, TIOCM_DTR | TIOCM_RTS);
diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c
index 8b44b08752d6..1c3de4c752d6 100644
--- a/drivers/usb/serial/f81534.c
+++ b/drivers/usb/serial/f81534.c
@@ -1456,9 +1456,9 @@ static int f81534_tiocmset(struct tty_struct *tty, unsigned int set,
return f81534_update_mctrl(port, set, clear);
}

-static void f81534_dtr_rts(struct usb_serial_port *port, bool on)
+static void f81534_dtr_rts(struct usb_serial_port *port, bool active)
{
- if (on)
+ if (active)
f81534_update_mctrl(port, TIOCM_DTR | TIOCM_RTS, 0);
else
f81534_update_mctrl(port, 0, TIOCM_DTR | TIOCM_RTS);
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 09bdf623e94e..002db8bc6a16 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2366,12 +2366,12 @@ static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
return usb_serial_generic_open(tty, port);
}

-static void ftdi_dtr_rts(struct usb_serial_port *port, bool on)
+static void ftdi_dtr_rts(struct usb_serial_port *port, bool active)
{
struct ftdi_private *priv = usb_get_serial_port_data(port);

/* Disable flow control */
- if (!on) {
+ if (!active) {
if (usb_control_msg(port->serial->dev,
usb_sndctrlpipe(port->serial->dev, 0),
FTDI_SIO_SET_FLOW_CTRL_REQUEST,
@@ -2382,7 +2382,7 @@ static void ftdi_dtr_rts(struct usb_serial_port *port, bool on)
}
}
/* drop RTS and DTR */
- if (on)
+ if (active)
set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
else
clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
index b1b7a033cc75..1937e4dfe2d9 100644
--- a/drivers/usb/serial/ipw.c
+++ b/drivers/usb/serial/ipw.c
@@ -215,18 +215,18 @@ static void ipw_release(struct usb_serial *serial)
kfree(data);
}

-static void ipw_dtr_rts(struct usb_serial_port *port, bool on)
+static void ipw_dtr_rts(struct usb_serial_port *port, bool active)
{
struct usb_device *udev = port->serial->dev;
struct device *dev = &port->dev;
int result;

- dev_dbg(dev, "%s: on = %d\n", __func__, on);
+ dev_dbg(dev, "%s: active = %d\n", __func__, active);

result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
IPW_SIO_SET_PIN,
USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT,
- on ? IPW_PIN_SETDTR : IPW_PIN_CLRDTR,
+ active ? IPW_PIN_SETDTR : IPW_PIN_CLRDTR,
0,
NULL,
0,
@@ -237,7 +237,7 @@ static void ipw_dtr_rts(struct usb_serial_port *port, bool on)
result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
IPW_SIO_SET_PIN, USB_TYPE_VENDOR |
USB_RECIP_INTERFACE | USB_DIR_OUT,
- on ? IPW_PIN_SETRTS : IPW_PIN_CLRRTS,
+ active ? IPW_PIN_SETRTS : IPW_PIN_CLRRTS,
0,
NULL,
0,
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 7e375367354b..241d7179d421 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -1564,12 +1564,12 @@ static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port)
return 0;
}

-static void keyspan_dtr_rts(struct usb_serial_port *port, bool on)
+static void keyspan_dtr_rts(struct usb_serial_port *port, bool active)
{
struct keyspan_port_private *p_priv = usb_get_serial_port_data(port);

- p_priv->rts_state = on;
- p_priv->dtr_state = on;
+ p_priv->rts_state = active;
+ p_priv->dtr_state = active;
keyspan_send_setup(port, 0);
}

diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index cb16c4bc8555..4a2e66c771fb 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -551,11 +551,11 @@ static int keyspan_pda_write(struct tty_struct *tty, struct usb_serial_port *por
return count;
}

-static void keyspan_pda_dtr_rts(struct usb_serial_port *port, bool on)
+static void keyspan_pda_dtr_rts(struct usb_serial_port *port, bool active)
{
struct usb_serial *serial = port->serial;

- if (on)
+ if (active)
keyspan_pda_set_modem_info(serial, BIT(7) | BIT(2));
else
keyspan_pda_set_modem_info(serial, 0);
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index eb3520490dd2..d871b7cbc550 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -42,7 +42,7 @@ static int mct_u232_port_probe(struct usb_serial_port *port);
static void mct_u232_port_remove(struct usb_serial_port *remove);
static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port);
static void mct_u232_close(struct usb_serial_port *port);
-static void mct_u232_dtr_rts(struct usb_serial_port *port, bool on);
+static void mct_u232_dtr_rts(struct usb_serial_port *port, bool active);
static void mct_u232_read_int_callback(struct urb *urb);
static void mct_u232_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
@@ -477,13 +477,13 @@ static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port)
return retval;
} /* mct_u232_open */

-static void mct_u232_dtr_rts(struct usb_serial_port *port, bool on)
+static void mct_u232_dtr_rts(struct usb_serial_port *port, bool active)
{
unsigned int control_state;
struct mct_u232_private *priv = usb_get_serial_port_data(port);

spin_lock_irq(&priv->lock);
- if (on)
+ if (active)
priv->control_state |= TIOCM_DTR | TIOCM_RTS;
else
priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS);
diff --git a/drivers/usb/serial/mxuport.c b/drivers/usb/serial/mxuport.c
index ac7594635719..da7c40db64c8 100644
--- a/drivers/usb/serial/mxuport.c
+++ b/drivers/usb/serial/mxuport.c
@@ -674,7 +674,7 @@ static int mxuport_set_rts(struct usb_serial_port *port, u8 state)
return err;
}

-static void mxuport_dtr_rts(struct usb_serial_port *port, bool on)
+static void mxuport_dtr_rts(struct usb_serial_port *port, bool active)
{
struct mxuport_port *mxport = usb_get_serial_port_data(port);
u8 mcr_state;
@@ -683,7 +683,7 @@ static void mxuport_dtr_rts(struct usb_serial_port *port, bool on)
mutex_lock(&mxport->mutex);
mcr_state = mxport->mcr_state;

- if (on)
+ if (active)
mcr_state |= (UART_MCR_RTS | UART_MCR_DTR);
else
mcr_state &= ~(UART_MCR_RTS | UART_MCR_DTR);
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index cb20911f35bb..da23412e6a54 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -931,14 +931,14 @@ static void pl2303_set_termios(struct tty_struct *tty,
kfree(buf);
}

-static void pl2303_dtr_rts(struct usb_serial_port *port, bool on)
+static void pl2303_dtr_rts(struct usb_serial_port *port, bool active)
{
struct pl2303_private *priv = usb_get_serial_port_data(port);
unsigned long flags;
u8 control;

spin_lock_irqsave(&priv->lock, flags);
- if (on)
+ if (active)
priv->line_control |= (CONTROL_DTR | CONTROL_RTS);
else
priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS);
diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c
index 6fd329ffec7e..7e513c6106b5 100644
--- a/drivers/usb/serial/quatech2.c
+++ b/drivers/usb/serial/quatech2.c
@@ -770,19 +770,19 @@ static void qt2_break_ctl(struct tty_struct *tty, int break_state)



-static void qt2_dtr_rts(struct usb_serial_port *port, bool on)
+static void qt2_dtr_rts(struct usb_serial_port *port, bool active)
{
struct usb_device *dev = port->serial->dev;
struct qt2_port_private *port_priv = usb_get_serial_port_data(port);

/* Disable flow control */
- if (!on) {
+ if (!active) {
if (qt2_setregister(dev, port_priv->device_port,
UART_MCR, 0) < 0)
dev_warn(&port->dev, "error from flowcontrol urb\n");
}
/* drop RTS and DTR */
- if (on)
+ if (active)
update_mctrl(port_priv, TIOCM_DTR | TIOCM_RTS, 0);
else
update_mctrl(port_priv, 0, TIOCM_DTR | TIOCM_RTS);
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index f2c3a7af1a4a..ed941acc49be 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -813,13 +813,13 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)
}


-static void sierra_dtr_rts(struct usb_serial_port *port, bool on)
+static void sierra_dtr_rts(struct usb_serial_port *port, bool active)
{
struct sierra_port_private *portdata;

portdata = usb_get_serial_port_data(port);
- portdata->rts_state = on;
- portdata->dtr_state = on;
+ portdata->rts_state = active;
+ portdata->dtr_state = active;

sierra_send_setup(port);
}
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
index 02402ea3bd1b..52b4194bd31d 100644
--- a/drivers/usb/serial/spcp8x5.c
+++ b/drivers/usb/serial/spcp8x5.c
@@ -256,14 +256,14 @@ static bool spcp8x5_carrier_raised(struct usb_serial_port *port)
return ret || msr & MSR_STATUS_LINE_DCD;
}

-static void spcp8x5_dtr_rts(struct usb_serial_port *port, bool on)
+static void spcp8x5_dtr_rts(struct usb_serial_port *port, bool active)
{
struct spcp8x5_private *priv = usb_get_serial_port_data(port);
unsigned long flags;
u8 control;

spin_lock_irqsave(&priv->lock, flags);
- if (on)
+ if (active)
priv->line_control = MCR_CONTROL_LINE_DTR
| MCR_CONTROL_LINE_RTS;
else
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
index 4cff39895804..dc85938c368b 100644
--- a/drivers/usb/serial/ssu100.c
+++ b/drivers/usb/serial/ssu100.c
@@ -385,17 +385,17 @@ static int ssu100_tiocmset(struct tty_struct *tty,
return update_mctrl(dev, set, clear);
}

-static void ssu100_dtr_rts(struct usb_serial_port *port, bool on)
+static void ssu100_dtr_rts(struct usb_serial_port *port, bool active)
{
struct usb_device *dev = port->serial->dev;

/* Disable flow control */
- if (!on) {
+ if (!active) {
if (ssu100_setregister(dev, 0, UART_MCR, 0) < 0)
dev_err(&port->dev, "error from flowcontrol urb\n");
}
/* drop RTS and DTR */
- if (on)
+ if (active)
set_mctrl(dev, TIOCM_DTR | TIOCM_RTS);
else
clear_mctrl(dev, TIOCM_DTR | TIOCM_RTS);
diff --git a/drivers/usb/serial/upd78f0730.c b/drivers/usb/serial/upd78f0730.c
index 206749fe3263..076667620a3f 100644
--- a/drivers/usb/serial/upd78f0730.c
+++ b/drivers/usb/serial/upd78f0730.c
@@ -262,13 +262,13 @@ static void upd78f0730_break_ctl(struct tty_struct *tty, int break_state)
mutex_unlock(&private->lock);
}

-static void upd78f0730_dtr_rts(struct usb_serial_port *port, bool on)
+static void upd78f0730_dtr_rts(struct usb_serial_port *port, bool active)
{
struct tty_struct *tty = port->port.tty;
unsigned int set = 0;
unsigned int clear = 0;

- if (on)
+ if (active)
set = TIOCM_DTR | TIOCM_RTS;
else
clear = TIOCM_DTR | TIOCM_RTS;
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index f8404073558b..1ff9d6893026 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -765,13 +765,13 @@ static bool serial_port_carrier_raised(struct tty_port *port)
return true;
}

-static void serial_port_dtr_rts(struct tty_port *port, bool on)
+static void serial_port_dtr_rts(struct tty_port *port, bool active)
{
struct usb_serial_port *p = container_of(port, struct usb_serial_port, port);
struct usb_serial_driver *drv = p->serial->type;

if (drv->dtr_rts)
- drv->dtr_rts(p, on);
+ drv->dtr_rts(p, active);
}

static ssize_t port_number_show(struct device *dev,
diff --git a/drivers/usb/serial/usb-wwan.h b/drivers/usb/serial/usb-wwan.h
index b2a07dd44225..3f558af789de 100644
--- a/drivers/usb/serial/usb-wwan.h
+++ b/drivers/usb/serial/usb-wwan.h
@@ -6,7 +6,7 @@
#ifndef __LINUX_USB_USB_WWAN
#define __LINUX_USB_USB_WWAN

-extern void usb_wwan_dtr_rts(struct usb_serial_port *port, bool on);
+extern void usb_wwan_dtr_rts(struct usb_serial_port *port, bool active);
extern int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port);
extern void usb_wwan_close(struct usb_serial_port *port);
extern int usb_wwan_port_probe(struct usb_serial_port *port);
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index 168b11cc02b6..78e7d597e2e3 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -69,7 +69,7 @@ static int usb_wwan_send_setup(struct usb_serial_port *port)
return res;
}

-void usb_wwan_dtr_rts(struct usb_serial_port *port, bool on)
+void usb_wwan_dtr_rts(struct usb_serial_port *port, bool active)
{
struct usb_wwan_port_private *portdata;
struct usb_wwan_intf_private *intfdata;
@@ -81,8 +81,8 @@ void usb_wwan_dtr_rts(struct usb_serial_port *port, bool on)

portdata = usb_get_serial_port_data(port);
/* FIXME: locking */
- portdata->rts_state = on;
- portdata->dtr_state = on;
+ portdata->rts_state = active;
+ portdata->dtr_state = active;

usb_wwan_send_setup(port);
}
diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c
index 9aaed09d45e4..b02e3eeec32f 100644
--- a/drivers/usb/serial/xr_serial.c
+++ b/drivers/usb/serial/xr_serial.c
@@ -495,9 +495,9 @@ static int xr_tiocmset(struct tty_struct *tty,
return xr_tiocmset_port(port, set, clear);
}

-static void xr_dtr_rts(struct usb_serial_port *port, bool on)
+static void xr_dtr_rts(struct usb_serial_port *port, bool active)
{
- if (on)
+ if (active)
xr_tiocmset_port(port, TIOCM_DTR | TIOCM_RTS, 0);
else
xr_tiocmset_port(port, 0, TIOCM_DTR | TIOCM_RTS);
--
2.30.2

2023-01-11 15:00:32

by Ilpo Järvinen

[permalink] [raw]
Subject: [PATCH v3 04/13] tty: moxa: Make local var storing tty_port_initialized() bool

Return type of tty_port_initialized() is bool, use matching type for
the local variable.

Also reorder the local vars to reverse-xmas-tree while at it.

Reviewed-by: Jiri Slaby <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
---
drivers/tty/moxa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
index bc474f3c3f8f..2d9635e14ded 100644
--- a/drivers/tty/moxa.c
+++ b/drivers/tty/moxa.c
@@ -1664,8 +1664,8 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
u16 __iomem *ip)
{
struct tty_struct *tty = tty_port_tty_get(&p->port);
+ bool inited = tty_port_initialized(&p->port);
void __iomem *ofsAddr;
- unsigned int inited = tty_port_initialized(&p->port);
u16 intr;

if (tty) {
--
2.30.2

2023-01-11 17:13:20

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH v3 13/13] usb/serial: Rename dtr/rts parameters/variables to active

On Wed, Jan 11, 2023 at 04:23:31PM +0200, Ilpo Järvinen wrote:
> Use active consistently for naming parameters and variables.
> This converts all USB serial drivers + CDC-ACM.
>
> Signed-off-by: Ilpo Järvinen <[email protected]>
> ---
> drivers/usb/class/cdc-acm.c | 4 ++--
> drivers/usb/serial/ch341.c | 4 ++--
> drivers/usb/serial/cp210x.c | 6 +++---
> drivers/usb/serial/cypress_m8.c | 6 +++---
> drivers/usb/serial/digi_acceleport.c | 6 +++---
> drivers/usb/serial/f81232.c | 4 ++--
> drivers/usb/serial/f81534.c | 4 ++--
> drivers/usb/serial/ftdi_sio.c | 6 +++---
> drivers/usb/serial/ipw.c | 8 ++++----
> drivers/usb/serial/keyspan.c | 6 +++---
> drivers/usb/serial/keyspan_pda.c | 4 ++--
> drivers/usb/serial/mct_u232.c | 6 +++---
> drivers/usb/serial/mxuport.c | 4 ++--
> drivers/usb/serial/pl2303.c | 4 ++--
> drivers/usb/serial/quatech2.c | 6 +++---
> drivers/usb/serial/sierra.c | 6 +++---
> drivers/usb/serial/spcp8x5.c | 4 ++--
> drivers/usb/serial/ssu100.c | 6 +++---
> drivers/usb/serial/upd78f0730.c | 4 ++--
> drivers/usb/serial/usb-serial.c | 4 ++--
> drivers/usb/serial/usb-wwan.h | 2 +-
> drivers/usb/serial/usb_wwan.c | 6 +++---
> drivers/usb/serial/xr_serial.c | 4 ++--
> 23 files changed, 57 insertions(+), 57 deletions(-)

You should split this up as CDC-ACM is not a USB serial driver.

But this all seem like unnecessary churn to me. It was one thing
changing the parameter name in drivers that used something ambiguous
like 'on_off' but 'on' is just as clear as 'active' (and its shorter
too).

So please drop at least the USB serial changes as all drivers already
use 'on' consistently.

Johan

2023-01-11 17:41:58

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH v3 10/13] tty: Return bool from tty_termios_hw_change()

On Wed, Jan 11, 2023 at 04:23:28PM +0200, Ilpo Järvinen wrote:
> Change tty_termios_hw_change() to return bool.
>
> Reviewed-by: Jiri Slaby <[email protected]>
> Signed-off-by: Ilpo Järvinen <[email protected]>

Reviewed-by: Johan Hovold <[email protected]>

2023-01-11 17:42:36

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH v3 07/13] tty: Convert ->dtr_rts() to take bool argument

On Wed, Jan 11, 2023 at 04:23:25PM +0200, Ilpo Järvinen wrote:
> Convert the raise/on parameter in ->dtr_rts() to bool through the
> callchain. The parameter is used like bool. In USB serial, there
> remains a few implicit bool -> larger type conversions because some
> devices use u8 in their control messages.
>
> In moxa_tiocmget(), dtr variable was reused for line status which
> requires int so use a separate variable for status.
>
> Reviewed-by: Jiri Slaby <[email protected]>
> Signed-off-by: Ilpo Järvinen <[email protected]>
> ---
> drivers/char/pcmcia/synclink_cs.c | 4 +--
> drivers/mmc/core/sdio_uart.c | 4 +--
> drivers/staging/greybus/uart.c | 2 +-
> drivers/tty/amiserial.c | 2 +-
> drivers/tty/hvc/hvc_console.c | 4 +--
> drivers/tty/hvc/hvc_console.h | 2 +-
> drivers/tty/hvc/hvc_iucv.c | 4 +--
> drivers/tty/moxa.c | 54 ++++++++++++++--------------
> drivers/tty/mxser.c | 2 +-
> drivers/tty/n_gsm.c | 2 +-
> drivers/tty/serial/serial_core.c | 8 ++---
> drivers/tty/synclink_gt.c | 2 +-
> drivers/tty/tty_port.c | 4 +--
> drivers/usb/class/cdc-acm.c | 2 +-
> drivers/usb/serial/ch341.c | 2 +-
> drivers/usb/serial/cp210x.c | 4 +--
> drivers/usb/serial/cypress_m8.c | 6 ++--
> drivers/usb/serial/digi_acceleport.c | 6 ++--
> drivers/usb/serial/f81232.c | 2 +-
> drivers/usb/serial/f81534.c | 2 +-
> drivers/usb/serial/ftdi_sio.c | 2 +-
> drivers/usb/serial/ipw.c | 2 +-
> drivers/usb/serial/keyspan.c | 2 +-
> drivers/usb/serial/keyspan_pda.c | 2 +-
> drivers/usb/serial/mct_u232.c | 4 +--
> drivers/usb/serial/mxuport.c | 2 +-
> drivers/usb/serial/pl2303.c | 2 +-
> drivers/usb/serial/quatech2.c | 2 +-
> drivers/usb/serial/sierra.c | 2 +-
> drivers/usb/serial/spcp8x5.c | 2 +-
> drivers/usb/serial/ssu100.c | 2 +-
> drivers/usb/serial/upd78f0730.c | 6 ++--
> drivers/usb/serial/usb-serial.c | 2 +-
> drivers/usb/serial/usb-wwan.h | 2 +-
> drivers/usb/serial/usb_wwan.c | 2 +-
> drivers/usb/serial/xr_serial.c | 6 ++--
> include/linux/tty_port.h | 4 +--
> include/linux/usb/serial.h | 2 +-
> 38 files changed, 84 insertions(+), 82 deletions(-)

Same here. No need to lump the tty-port changes with USB-serial changes.

Johan

2023-01-13 12:07:15

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH v3 07/13] tty: Convert ->dtr_rts() to take bool argument

On Wed, 11 Jan 2023 at 15:24, Ilpo Järvinen
<[email protected]> wrote:
>
> Convert the raise/on parameter in ->dtr_rts() to bool through the
> callchain. The parameter is used like bool. In USB serial, there
> remains a few implicit bool -> larger type conversions because some
> devices use u8 in their control messages.
>
> In moxa_tiocmget(), dtr variable was reused for line status which
> requires int so use a separate variable for status.
>
> Reviewed-by: Jiri Slaby <[email protected]>
> Signed-off-by: Ilpo Järvinen <[email protected]>

Acked-by: Ulf Hansson <[email protected]> # For MMC

Kind regards
Uffe


> ---
> drivers/char/pcmcia/synclink_cs.c | 4 +--
> drivers/mmc/core/sdio_uart.c | 4 +--
> drivers/staging/greybus/uart.c | 2 +-
> drivers/tty/amiserial.c | 2 +-
> drivers/tty/hvc/hvc_console.c | 4 +--
> drivers/tty/hvc/hvc_console.h | 2 +-
> drivers/tty/hvc/hvc_iucv.c | 4 +--
> drivers/tty/moxa.c | 54 ++++++++++++++--------------
> drivers/tty/mxser.c | 2 +-
> drivers/tty/n_gsm.c | 2 +-
> drivers/tty/serial/serial_core.c | 8 ++---
> drivers/tty/synclink_gt.c | 2 +-
> drivers/tty/tty_port.c | 4 +--
> drivers/usb/class/cdc-acm.c | 2 +-
> drivers/usb/serial/ch341.c | 2 +-
> drivers/usb/serial/cp210x.c | 4 +--
> drivers/usb/serial/cypress_m8.c | 6 ++--
> drivers/usb/serial/digi_acceleport.c | 6 ++--
> drivers/usb/serial/f81232.c | 2 +-
> drivers/usb/serial/f81534.c | 2 +-
> drivers/usb/serial/ftdi_sio.c | 2 +-
> drivers/usb/serial/ipw.c | 2 +-
> drivers/usb/serial/keyspan.c | 2 +-
> drivers/usb/serial/keyspan_pda.c | 2 +-
> drivers/usb/serial/mct_u232.c | 4 +--
> drivers/usb/serial/mxuport.c | 2 +-
> drivers/usb/serial/pl2303.c | 2 +-
> drivers/usb/serial/quatech2.c | 2 +-
> drivers/usb/serial/sierra.c | 2 +-
> drivers/usb/serial/spcp8x5.c | 2 +-
> drivers/usb/serial/ssu100.c | 2 +-
> drivers/usb/serial/upd78f0730.c | 6 ++--
> drivers/usb/serial/usb-serial.c | 2 +-
> drivers/usb/serial/usb-wwan.h | 2 +-
> drivers/usb/serial/usb_wwan.c | 2 +-
> drivers/usb/serial/xr_serial.c | 6 ++--
> include/linux/tty_port.h | 4 +--
> include/linux/usb/serial.h | 2 +-
> 38 files changed, 84 insertions(+), 82 deletions(-)
>
> diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
> index 4391138e1b8a..46a0b586d234 100644
> --- a/drivers/char/pcmcia/synclink_cs.c
> +++ b/drivers/char/pcmcia/synclink_cs.c
> @@ -378,7 +378,7 @@ static void async_mode(MGSLPC_INFO *info);
> static void tx_timeout(struct timer_list *t);
>
> static bool carrier_raised(struct tty_port *port);
> -static void dtr_rts(struct tty_port *port, int onoff);
> +static void dtr_rts(struct tty_port *port, bool onoff);
>
> #if SYNCLINK_GENERIC_HDLC
> #define dev_to_port(D) (dev_to_hdlc(D)->priv)
> @@ -2442,7 +2442,7 @@ static bool carrier_raised(struct tty_port *port)
> return info->serial_signals & SerialSignal_DCD;
> }
>
> -static void dtr_rts(struct tty_port *port, int onoff)
> +static void dtr_rts(struct tty_port *port, bool onoff)
> {
> MGSLPC_INFO *info = container_of(port, MGSLPC_INFO, port);
> unsigned long flags;
> diff --git a/drivers/mmc/core/sdio_uart.c b/drivers/mmc/core/sdio_uart.c
> index 47f58258d8ff..c6b4b2b2a4b2 100644
> --- a/drivers/mmc/core/sdio_uart.c
> +++ b/drivers/mmc/core/sdio_uart.c
> @@ -548,14 +548,14 @@ static bool uart_carrier_raised(struct tty_port *tport)
> * adjusted during an open, close and hangup.
> */
>
> -static void uart_dtr_rts(struct tty_port *tport, int onoff)
> +static void uart_dtr_rts(struct tty_port *tport, bool onoff)
> {
> struct sdio_uart_port *port =
> container_of(tport, struct sdio_uart_port, port);
> int ret = sdio_uart_claim_func(port);
> if (ret)
> return;
> - if (onoff == 0)
> + if (!onoff)
> sdio_uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
> else
> sdio_uart_set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
> diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c
> index 90ff07f2cbf7..92d49740d5a4 100644
> --- a/drivers/staging/greybus/uart.c
> +++ b/drivers/staging/greybus/uart.c
> @@ -701,7 +701,7 @@ static int gb_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
> return -ENOIOCTLCMD;
> }
>
> -static void gb_tty_dtr_rts(struct tty_port *port, int on)
> +static void gb_tty_dtr_rts(struct tty_port *port, bool on)
> {
> struct gb_tty *gb_tty;
> u8 newctrl;
> diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
> index 01c4fd3ce7c8..29d4c554f6b8 100644
> --- a/drivers/tty/amiserial.c
> +++ b/drivers/tty/amiserial.c
> @@ -1459,7 +1459,7 @@ static bool amiga_carrier_raised(struct tty_port *port)
> return !(ciab.pra & SER_DCD);
> }
>
> -static void amiga_dtr_rts(struct tty_port *port, int raise)
> +static void amiga_dtr_rts(struct tty_port *port, bool raise)
> {
> struct serial_state *info = container_of(port, struct serial_state,
> tport);
> diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
> index a683e21df19c..10c10cfdf92a 100644
> --- a/drivers/tty/hvc/hvc_console.c
> +++ b/drivers/tty/hvc/hvc_console.c
> @@ -376,7 +376,7 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
> /* We are ready... raise DTR/RTS */
> if (C_BAUD(tty))
> if (hp->ops->dtr_rts)
> - hp->ops->dtr_rts(hp, 1);
> + hp->ops->dtr_rts(hp, true);
> tty_port_set_initialized(&hp->port, true);
> }
>
> @@ -406,7 +406,7 @@ static void hvc_close(struct tty_struct *tty, struct file * filp)
>
> if (C_HUPCL(tty))
> if (hp->ops->dtr_rts)
> - hp->ops->dtr_rts(hp, 0);
> + hp->ops->dtr_rts(hp, false);
>
> if (hp->ops->notifier_del)
> hp->ops->notifier_del(hp, hp->data);
> diff --git a/drivers/tty/hvc/hvc_console.h b/drivers/tty/hvc/hvc_console.h
> index 18d005814e4b..6d3428bf868f 100644
> --- a/drivers/tty/hvc/hvc_console.h
> +++ b/drivers/tty/hvc/hvc_console.h
> @@ -66,7 +66,7 @@ struct hv_ops {
> int (*tiocmset)(struct hvc_struct *hp, unsigned int set, unsigned int clear);
>
> /* Callbacks to handle tty ports */
> - void (*dtr_rts)(struct hvc_struct *hp, int raise);
> + void (*dtr_rts)(struct hvc_struct *hp, bool raise);
> };
>
> /* Register a vterm and a slot index for use as a console (console_init) */
> diff --git a/drivers/tty/hvc/hvc_iucv.c b/drivers/tty/hvc/hvc_iucv.c
> index 7d49a872de48..fe862a6882d6 100644
> --- a/drivers/tty/hvc/hvc_iucv.c
> +++ b/drivers/tty/hvc/hvc_iucv.c
> @@ -658,13 +658,13 @@ static void hvc_iucv_notifier_hangup(struct hvc_struct *hp, int id)
> /**
> * hvc_iucv_dtr_rts() - HVC notifier for handling DTR/RTS
> * @hp: Pointer the HVC device (struct hvc_struct)
> - * @raise: Non-zero to raise or zero to lower DTR/RTS lines
> + * @raise: True to raise or false to lower DTR/RTS lines
> *
> * This routine notifies the HVC back-end to raise or lower DTR/RTS
> * lines. Raising DTR/RTS is ignored. Lowering DTR/RTS indicates to
> * drop the IUCV connection (similar to hang up the modem).
> */
> -static void hvc_iucv_dtr_rts(struct hvc_struct *hp, int raise)
> +static void hvc_iucv_dtr_rts(struct hvc_struct *hp, bool raise)
> {
> struct hvc_iucv_private *priv;
> struct iucv_path *path;
> diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
> index 6a1e78e33a2c..9be3d585d5a9 100644
> --- a/drivers/tty/moxa.c
> +++ b/drivers/tty/moxa.c
> @@ -502,15 +502,15 @@ static void moxa_poll(struct timer_list *);
> static void moxa_set_tty_param(struct tty_struct *, const struct ktermios *);
> static void moxa_shutdown(struct tty_port *);
> static bool moxa_carrier_raised(struct tty_port *);
> -static void moxa_dtr_rts(struct tty_port *, int);
> +static void moxa_dtr_rts(struct tty_port *, bool);
> /*
> * moxa board interface functions:
> */
> static void MoxaPortEnable(struct moxa_port *);
> static void MoxaPortDisable(struct moxa_port *);
> static int MoxaPortSetTermio(struct moxa_port *, struct ktermios *, speed_t);
> -static int MoxaPortGetLineOut(struct moxa_port *, int *, int *);
> -static void MoxaPortLineCtrl(struct moxa_port *, int, int);
> +static int MoxaPortGetLineOut(struct moxa_port *, bool *, bool *);
> +static void MoxaPortLineCtrl(struct moxa_port *, bool, bool);
> static void MoxaPortFlowCtrl(struct moxa_port *, int, int, int, int, int);
> static int MoxaPortLineStatus(struct moxa_port *);
> static void MoxaPortFlushData(struct moxa_port *, int);
> @@ -1443,7 +1443,7 @@ static bool moxa_carrier_raised(struct tty_port *port)
> return dcd;
> }
>
> -static void moxa_dtr_rts(struct tty_port *port, int onoff)
> +static void moxa_dtr_rts(struct tty_port *port, bool onoff)
> {
> struct moxa_port *ch = container_of(port, struct moxa_port, port);
> MoxaPortLineCtrl(ch, onoff, onoff);
> @@ -1481,7 +1481,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
> if (!tty_port_initialized(&ch->port)) {
> ch->statusflags = 0;
> moxa_set_tty_param(tty, &tty->termios);
> - MoxaPortLineCtrl(ch, 1, 1);
> + MoxaPortLineCtrl(ch, true, true);
> MoxaPortEnable(ch);
> MoxaSetFifo(ch, ch->type == PORT_16550A);
> tty_port_set_initialized(&ch->port, true);
> @@ -1557,19 +1557,21 @@ static unsigned int moxa_chars_in_buffer(struct tty_struct *tty)
> static int moxa_tiocmget(struct tty_struct *tty)
> {
> struct moxa_port *ch = tty->driver_data;
> - int flag = 0, dtr, rts;
> + bool dtr, rts;
> + int flag = 0;
> + int status;
>
> MoxaPortGetLineOut(ch, &dtr, &rts);
> if (dtr)
> flag |= TIOCM_DTR;
> if (rts)
> flag |= TIOCM_RTS;
> - dtr = MoxaPortLineStatus(ch);
> - if (dtr & 1)
> + status = MoxaPortLineStatus(ch);
> + if (status & 1)
> flag |= TIOCM_CTS;
> - if (dtr & 2)
> + if (status & 2)
> flag |= TIOCM_DSR;
> - if (dtr & 4)
> + if (status & 4)
> flag |= TIOCM_CD;
> return flag;
> }
> @@ -1578,7 +1580,7 @@ static int moxa_tiocmset(struct tty_struct *tty,
> unsigned int set, unsigned int clear)
> {
> struct moxa_port *ch;
> - int dtr, rts;
> + bool dtr, rts;
>
> mutex_lock(&moxa_openlock);
> ch = tty->driver_data;
> @@ -1589,13 +1591,13 @@ static int moxa_tiocmset(struct tty_struct *tty,
>
> MoxaPortGetLineOut(ch, &dtr, &rts);
> if (set & TIOCM_RTS)
> - rts = 1;
> + rts = true;
> if (set & TIOCM_DTR)
> - dtr = 1;
> + dtr = true;
> if (clear & TIOCM_RTS)
> - rts = 0;
> + rts = false;
> if (clear & TIOCM_DTR)
> - dtr = 0;
> + dtr = false;
> MoxaPortLineCtrl(ch, dtr, rts);
> mutex_unlock(&moxa_openlock);
> return 0;
> @@ -1877,12 +1879,12 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode)
> *
> * Function 13: Get the DTR/RTS state of this port.
> * Syntax:
> - * int MoxaPortGetLineOut(int port, int *dtrState, int *rtsState);
> + * int MoxaPortGetLineOut(int port, bool *dtrState, bool *rtsState);
> * int port : port number (0 - 127)
> - * int * dtrState : pointer to INT to receive the current DTR
> + * bool * dtrState : pointer to bool to receive the current DTR
> * state. (if NULL, this function will not
> * write to this address)
> - * int * rtsState : pointer to INT to receive the current RTS
> + * bool * rtsState : pointer to bool to receive the current RTS
> * state. (if NULL, this function will not
> * write to this address)
> *
> @@ -1892,10 +1894,10 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode)
> *
> * Function 14: Setting the DTR/RTS output state of this port.
> * Syntax:
> - * void MoxaPortLineCtrl(int port, int dtrState, int rtsState);
> + * void MoxaPortLineCtrl(int port, bool dtrState, bool rtsState);
> * int port : port number (0 - 127)
> - * int dtrState : DTR output state (0: off, 1: on)
> - * int rtsState : RTS output state (0: off, 1: on)
> + * bool dtrState : DTR output state
> + * bool rtsState : RTS output state
> *
> *
> * Function 15: Setting the flow control of this port.
> @@ -2103,18 +2105,18 @@ static int MoxaPortSetTermio(struct moxa_port *port, struct ktermios *termio,
> return baud;
> }
>
> -static int MoxaPortGetLineOut(struct moxa_port *port, int *dtrState,
> - int *rtsState)
> +static int MoxaPortGetLineOut(struct moxa_port *port, bool *dtrState,
> + bool *rtsState)
> {
> if (dtrState)
> - *dtrState = !!(port->lineCtrl & DTR_ON);
> + *dtrState = port->lineCtrl & DTR_ON;
> if (rtsState)
> - *rtsState = !!(port->lineCtrl & RTS_ON);
> + *rtsState = port->lineCtrl & RTS_ON;
>
> return 0;
> }
>
> -static void MoxaPortLineCtrl(struct moxa_port *port, int dtr, int rts)
> +static void MoxaPortLineCtrl(struct moxa_port *port, bool dtr, bool rts)
> {
> u8 mode = 0;
>
> diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
> index 96c72e691cd7..d4fb11e39bb1 100644
> --- a/drivers/tty/mxser.c
> +++ b/drivers/tty/mxser.c
> @@ -465,7 +465,7 @@ static bool mxser_carrier_raised(struct tty_port *port)
> return inb(mp->ioaddr + UART_MSR) & UART_MSR_DCD;
> }
>
> -static void mxser_dtr_rts(struct tty_port *port, int on)
> +static void mxser_dtr_rts(struct tty_port *port, bool on)
> {
> struct mxser_port *mp = container_of(port, struct mxser_port, port);
> unsigned long flags;
> diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
> index 81fc2ec3693f..8dd0d6441c42 100644
> --- a/drivers/tty/n_gsm.c
> +++ b/drivers/tty/n_gsm.c
> @@ -3792,7 +3792,7 @@ static bool gsm_carrier_raised(struct tty_port *port)
> return dlci->modem_rx & TIOCM_CD;
> }
>
> -static void gsm_dtr_rts(struct tty_port *port, int onoff)
> +static void gsm_dtr_rts(struct tty_port *port, bool onoff)
> {
> struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port);
> unsigned int modem_tx = dlci->modem_tx;
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index 20ed8a088b2d..053535846ba2 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -169,7 +169,7 @@ uart_update_mctrl(struct uart_port *port, unsigned int set, unsigned int clear)
> #define uart_set_mctrl(port, set) uart_update_mctrl(port, set, 0)
> #define uart_clear_mctrl(port, clear) uart_update_mctrl(port, 0, clear)
>
> -static void uart_port_dtr_rts(struct uart_port *uport, int raise)
> +static void uart_port_dtr_rts(struct uart_port *uport, bool raise)
> {
> if (raise)
> uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
> @@ -239,7 +239,7 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
> * port is open and ready to respond.
> */
> if (init_hw && C_BAUD(tty))
> - uart_port_dtr_rts(uport, 1);
> + uart_port_dtr_rts(uport, true);
> }
>
> /*
> @@ -302,7 +302,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)
> }
>
> if (!tty || C_HUPCL(tty))
> - uart_port_dtr_rts(uport, 0);
> + uart_port_dtr_rts(uport, false);
>
> uart_port_shutdown(port);
> }
> @@ -1885,7 +1885,7 @@ static bool uart_carrier_raised(struct tty_port *port)
> return mctrl & TIOCM_CAR;
> }
>
> -static void uart_dtr_rts(struct tty_port *port, int raise)
> +static void uart_dtr_rts(struct tty_port *port, bool raise)
> {
> struct uart_state *state = container_of(port, struct uart_state, port);
> struct uart_port *uport;
> diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
> index 4ba71ec764f7..2b786265ce7b 100644
> --- a/drivers/tty/synclink_gt.c
> +++ b/drivers/tty/synclink_gt.c
> @@ -3138,7 +3138,7 @@ static bool carrier_raised(struct tty_port *port)
> return info->signals & SerialSignal_DCD;
> }
>
> -static void dtr_rts(struct tty_port *port, int on)
> +static void dtr_rts(struct tty_port *port, bool on)
> {
> unsigned long flags;
> struct slgt_info *info = container_of(port, struct slgt_info, port);
> diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
> index a573c500f95b..a788a6bf487d 100644
> --- a/drivers/tty/tty_port.c
> +++ b/drivers/tty/tty_port.c
> @@ -463,7 +463,7 @@ EXPORT_SYMBOL(tty_port_carrier_raised);
> void tty_port_raise_dtr_rts(struct tty_port *port)
> {
> if (port->ops->dtr_rts)
> - port->ops->dtr_rts(port, 1);
> + port->ops->dtr_rts(port, true);
> }
> EXPORT_SYMBOL(tty_port_raise_dtr_rts);
>
> @@ -478,7 +478,7 @@ EXPORT_SYMBOL(tty_port_raise_dtr_rts);
> void tty_port_lower_dtr_rts(struct tty_port *port)
> {
> if (port->ops->dtr_rts)
> - port->ops->dtr_rts(port, 0);
> + port->ops->dtr_rts(port, false);
> }
> EXPORT_SYMBOL(tty_port_lower_dtr_rts);
>
> diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
> index 36bf051b345b..d4f9220b8162 100644
> --- a/drivers/usb/class/cdc-acm.c
> +++ b/drivers/usb/class/cdc-acm.c
> @@ -651,7 +651,7 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
> return tty_port_open(&acm->port, tty, filp);
> }
>
> -static void acm_port_dtr_rts(struct tty_port *port, int raise)
> +static void acm_port_dtr_rts(struct tty_port *port, bool raise)
> {
> struct acm *acm = container_of(port, struct acm, port);
> int val;
> diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
> index 792f01a4ed22..98ec4fe46914 100644
> --- a/drivers/usb/serial/ch341.c
> +++ b/drivers/usb/serial/ch341.c
> @@ -420,7 +420,7 @@ static bool ch341_carrier_raised(struct usb_serial_port *port)
> return priv->msr & CH341_BIT_DCD;
> }
>
> -static void ch341_dtr_rts(struct usb_serial_port *port, int on)
> +static void ch341_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct ch341_private *priv = usb_get_serial_port_data(port);
> unsigned long flags;
> diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
> index 67372acc2352..fe2cdc477fb9 100644
> --- a/drivers/usb/serial/cp210x.c
> +++ b/drivers/usb/serial/cp210x.c
> @@ -45,7 +45,7 @@ static void cp210x_disconnect(struct usb_serial *);
> static void cp210x_release(struct usb_serial *);
> static int cp210x_port_probe(struct usb_serial_port *);
> static void cp210x_port_remove(struct usb_serial_port *);
> -static void cp210x_dtr_rts(struct usb_serial_port *port, int on);
> +static void cp210x_dtr_rts(struct usb_serial_port *port, bool on);
> static void cp210x_process_read_urb(struct urb *urb);
> static void cp210x_enable_event_mode(struct usb_serial_port *port);
> static void cp210x_disable_event_mode(struct usb_serial_port *port);
> @@ -1402,7 +1402,7 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port,
> return ret;
> }
>
> -static void cp210x_dtr_rts(struct usb_serial_port *port, int on)
> +static void cp210x_dtr_rts(struct usb_serial_port *port, bool on)
> {
> if (on)
> cp210x_tiocmset_port(port, TIOCM_DTR | TIOCM_RTS, 0);
> diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
> index 1e0c028c5ec9..7c6060c17ee0 100644
> --- a/drivers/usb/serial/cypress_m8.c
> +++ b/drivers/usb/serial/cypress_m8.c
> @@ -118,7 +118,7 @@ static int cypress_ca42v2_port_probe(struct usb_serial_port *port);
> static void cypress_port_remove(struct usb_serial_port *port);
> static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port);
> static void cypress_close(struct usb_serial_port *port);
> -static void cypress_dtr_rts(struct usb_serial_port *port, int on);
> +static void cypress_dtr_rts(struct usb_serial_port *port, bool on);
> static int cypress_write(struct tty_struct *tty, struct usb_serial_port *port,
> const unsigned char *buf, int count);
> static void cypress_send(struct usb_serial_port *port);
> @@ -621,12 +621,12 @@ static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port)
> return result;
> } /* cypress_open */
>
> -static void cypress_dtr_rts(struct usb_serial_port *port, int on)
> +static void cypress_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct cypress_private *priv = usb_get_serial_port_data(port);
> /* drop dtr and rts */
> spin_lock_irq(&priv->lock);
> - if (on == 0)
> + if (!on)
> priv->line_control = 0;
> else
> priv->line_control = CONTROL_DTR | CONTROL_RTS;
> diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
> index 45d688e9b93f..890e446273d7 100644
> --- a/drivers/usb/serial/digi_acceleport.c
> +++ b/drivers/usb/serial/digi_acceleport.c
> @@ -228,7 +228,7 @@ static unsigned int digi_write_room(struct tty_struct *tty);
> static unsigned int digi_chars_in_buffer(struct tty_struct *tty);
> static int digi_open(struct tty_struct *tty, struct usb_serial_port *port);
> static void digi_close(struct usb_serial_port *port);
> -static void digi_dtr_rts(struct usb_serial_port *port, int on);
> +static void digi_dtr_rts(struct usb_serial_port *port, bool on);
> static int digi_startup_device(struct usb_serial *serial);
> static int digi_startup(struct usb_serial *serial);
> static void digi_disconnect(struct usb_serial *serial);
> @@ -1060,10 +1060,10 @@ static unsigned int digi_chars_in_buffer(struct tty_struct *tty)
> return chars;
> }
>
> -static void digi_dtr_rts(struct usb_serial_port *port, int on)
> +static void digi_dtr_rts(struct usb_serial_port *port, bool on)
> {
> /* Adjust DTR and RTS */
> - digi_set_modem_signals(port, on * (TIOCM_DTR | TIOCM_RTS), 1);
> + digi_set_modem_signals(port, on ? (TIOCM_DTR | TIOCM_RTS) : 0, 1);
> }
>
> static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
> diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
> index 1a8c2925c26f..1656be847460 100644
> --- a/drivers/usb/serial/f81232.c
> +++ b/drivers/usb/serial/f81232.c
> @@ -752,7 +752,7 @@ static void f81232_close(struct usb_serial_port *port)
> flush_work(&port_priv->lsr_work);
> }
>
> -static void f81232_dtr_rts(struct usb_serial_port *port, int on)
> +static void f81232_dtr_rts(struct usb_serial_port *port, bool on)
> {
> if (on)
> f81232_set_mctrl(port, TIOCM_DTR | TIOCM_RTS, 0);
> diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c
> index 4083ae961be4..8b44b08752d6 100644
> --- a/drivers/usb/serial/f81534.c
> +++ b/drivers/usb/serial/f81534.c
> @@ -1456,7 +1456,7 @@ static int f81534_tiocmset(struct tty_struct *tty, unsigned int set,
> return f81534_update_mctrl(port, set, clear);
> }
>
> -static void f81534_dtr_rts(struct usb_serial_port *port, int on)
> +static void f81534_dtr_rts(struct usb_serial_port *port, bool on)
> {
> if (on)
> f81534_update_mctrl(port, TIOCM_DTR | TIOCM_RTS, 0);
> diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
> index 05e28a5ce42b..09bdf623e94e 100644
> --- a/drivers/usb/serial/ftdi_sio.c
> +++ b/drivers/usb/serial/ftdi_sio.c
> @@ -2366,7 +2366,7 @@ static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
> return usb_serial_generic_open(tty, port);
> }
>
> -static void ftdi_dtr_rts(struct usb_serial_port *port, int on)
> +static void ftdi_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct ftdi_private *priv = usb_get_serial_port_data(port);
>
> diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
> index d04c7cc5c1c2..b1b7a033cc75 100644
> --- a/drivers/usb/serial/ipw.c
> +++ b/drivers/usb/serial/ipw.c
> @@ -215,7 +215,7 @@ static void ipw_release(struct usb_serial *serial)
> kfree(data);
> }
>
> -static void ipw_dtr_rts(struct usb_serial_port *port, int on)
> +static void ipw_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct usb_device *udev = port->serial->dev;
> struct device *dev = &port->dev;
> diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
> index 2966e0c4941e..7e375367354b 100644
> --- a/drivers/usb/serial/keyspan.c
> +++ b/drivers/usb/serial/keyspan.c
> @@ -1564,7 +1564,7 @@ static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port)
> return 0;
> }
>
> -static void keyspan_dtr_rts(struct usb_serial_port *port, int on)
> +static void keyspan_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct keyspan_port_private *p_priv = usb_get_serial_port_data(port);
>
> diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
> index 6fd15cd9e1eb..cb16c4bc8555 100644
> --- a/drivers/usb/serial/keyspan_pda.c
> +++ b/drivers/usb/serial/keyspan_pda.c
> @@ -551,7 +551,7 @@ static int keyspan_pda_write(struct tty_struct *tty, struct usb_serial_port *por
> return count;
> }
>
> -static void keyspan_pda_dtr_rts(struct usb_serial_port *port, int on)
> +static void keyspan_pda_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct usb_serial *serial = port->serial;
>
> diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
> index d3852feb81a4..eb3520490dd2 100644
> --- a/drivers/usb/serial/mct_u232.c
> +++ b/drivers/usb/serial/mct_u232.c
> @@ -42,7 +42,7 @@ static int mct_u232_port_probe(struct usb_serial_port *port);
> static void mct_u232_port_remove(struct usb_serial_port *remove);
> static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port);
> static void mct_u232_close(struct usb_serial_port *port);
> -static void mct_u232_dtr_rts(struct usb_serial_port *port, int on);
> +static void mct_u232_dtr_rts(struct usb_serial_port *port, bool on);
> static void mct_u232_read_int_callback(struct urb *urb);
> static void mct_u232_set_termios(struct tty_struct *tty,
> struct usb_serial_port *port,
> @@ -477,7 +477,7 @@ static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port)
> return retval;
> } /* mct_u232_open */
>
> -static void mct_u232_dtr_rts(struct usb_serial_port *port, int on)
> +static void mct_u232_dtr_rts(struct usb_serial_port *port, bool on)
> {
> unsigned int control_state;
> struct mct_u232_private *priv = usb_get_serial_port_data(port);
> diff --git a/drivers/usb/serial/mxuport.c b/drivers/usb/serial/mxuport.c
> index faa0eedfe245..ac7594635719 100644
> --- a/drivers/usb/serial/mxuport.c
> +++ b/drivers/usb/serial/mxuport.c
> @@ -674,7 +674,7 @@ static int mxuport_set_rts(struct usb_serial_port *port, u8 state)
> return err;
> }
>
> -static void mxuport_dtr_rts(struct usb_serial_port *port, int on)
> +static void mxuport_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct mxuport_port *mxport = usb_get_serial_port_data(port);
> u8 mcr_state;
> diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
> index 4cb81746a149..cb20911f35bb 100644
> --- a/drivers/usb/serial/pl2303.c
> +++ b/drivers/usb/serial/pl2303.c
> @@ -931,7 +931,7 @@ static void pl2303_set_termios(struct tty_struct *tty,
> kfree(buf);
> }
>
> -static void pl2303_dtr_rts(struct usb_serial_port *port, int on)
> +static void pl2303_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct pl2303_private *priv = usb_get_serial_port_data(port);
> unsigned long flags;
> diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c
> index 6fca40ace83a..6fd329ffec7e 100644
> --- a/drivers/usb/serial/quatech2.c
> +++ b/drivers/usb/serial/quatech2.c
> @@ -770,7 +770,7 @@ static void qt2_break_ctl(struct tty_struct *tty, int break_state)
>
>
>
> -static void qt2_dtr_rts(struct usb_serial_port *port, int on)
> +static void qt2_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct usb_device *dev = port->serial->dev;
> struct qt2_port_private *port_priv = usb_get_serial_port_data(port);
> diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
> index 353b2549eaa8..f2c3a7af1a4a 100644
> --- a/drivers/usb/serial/sierra.c
> +++ b/drivers/usb/serial/sierra.c
> @@ -813,7 +813,7 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)
> }
>
>
> -static void sierra_dtr_rts(struct usb_serial_port *port, int on)
> +static void sierra_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct sierra_port_private *portdata;
>
> diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
> index 8175db6c4554..02402ea3bd1b 100644
> --- a/drivers/usb/serial/spcp8x5.c
> +++ b/drivers/usb/serial/spcp8x5.c
> @@ -256,7 +256,7 @@ static bool spcp8x5_carrier_raised(struct usb_serial_port *port)
> return ret || msr & MSR_STATUS_LINE_DCD;
> }
>
> -static void spcp8x5_dtr_rts(struct usb_serial_port *port, int on)
> +static void spcp8x5_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct spcp8x5_private *priv = usb_get_serial_port_data(port);
> unsigned long flags;
> diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
> index 1e1888b66305..4cff39895804 100644
> --- a/drivers/usb/serial/ssu100.c
> +++ b/drivers/usb/serial/ssu100.c
> @@ -385,7 +385,7 @@ static int ssu100_tiocmset(struct tty_struct *tty,
> return update_mctrl(dev, set, clear);
> }
>
> -static void ssu100_dtr_rts(struct usb_serial_port *port, int on)
> +static void ssu100_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct usb_device *dev = port->serial->dev;
>
> diff --git a/drivers/usb/serial/upd78f0730.c b/drivers/usb/serial/upd78f0730.c
> index c47439bd90fa..206749fe3263 100644
> --- a/drivers/usb/serial/upd78f0730.c
> +++ b/drivers/usb/serial/upd78f0730.c
> @@ -262,7 +262,7 @@ static void upd78f0730_break_ctl(struct tty_struct *tty, int break_state)
> mutex_unlock(&private->lock);
> }
>
> -static void upd78f0730_dtr_rts(struct usb_serial_port *port, int on)
> +static void upd78f0730_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct tty_struct *tty = port->port.tty;
> unsigned int set = 0;
> @@ -307,9 +307,9 @@ static void upd78f0730_set_termios(struct tty_struct *tty,
> return;
>
> if (C_BAUD(tty) == B0)
> - upd78f0730_dtr_rts(port, 0);
> + upd78f0730_dtr_rts(port, false);
> else if (old_termios && (old_termios->c_cflag & CBAUD) == B0)
> - upd78f0730_dtr_rts(port, 1);
> + upd78f0730_dtr_rts(port, true);
>
> baud_rate = upd78f0730_get_baud_rate(tty);
> request.opcode = UPD78F0730_CMD_LINE_CONTROL;
> diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
> index 019720a63fac..f8404073558b 100644
> --- a/drivers/usb/serial/usb-serial.c
> +++ b/drivers/usb/serial/usb-serial.c
> @@ -765,7 +765,7 @@ static bool serial_port_carrier_raised(struct tty_port *port)
> return true;
> }
>
> -static void serial_port_dtr_rts(struct tty_port *port, int on)
> +static void serial_port_dtr_rts(struct tty_port *port, bool on)
> {
> struct usb_serial_port *p = container_of(port, struct usb_serial_port, port);
> struct usb_serial_driver *drv = p->serial->type;
> diff --git a/drivers/usb/serial/usb-wwan.h b/drivers/usb/serial/usb-wwan.h
> index 519101945769..b2a07dd44225 100644
> --- a/drivers/usb/serial/usb-wwan.h
> +++ b/drivers/usb/serial/usb-wwan.h
> @@ -6,7 +6,7 @@
> #ifndef __LINUX_USB_USB_WWAN
> #define __LINUX_USB_USB_WWAN
>
> -extern void usb_wwan_dtr_rts(struct usb_serial_port *port, int on);
> +extern void usb_wwan_dtr_rts(struct usb_serial_port *port, bool on);
> extern int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port);
> extern void usb_wwan_close(struct usb_serial_port *port);
> extern int usb_wwan_port_probe(struct usb_serial_port *port);
> diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
> index 0017f6e969e1..168b11cc02b6 100644
> --- a/drivers/usb/serial/usb_wwan.c
> +++ b/drivers/usb/serial/usb_wwan.c
> @@ -69,7 +69,7 @@ static int usb_wwan_send_setup(struct usb_serial_port *port)
> return res;
> }
>
> -void usb_wwan_dtr_rts(struct usb_serial_port *port, int on)
> +void usb_wwan_dtr_rts(struct usb_serial_port *port, bool on)
> {
> struct usb_wwan_port_private *portdata;
> struct usb_wwan_intf_private *intfdata;
> diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c
> index fdb0aae546c3..9aaed09d45e4 100644
> --- a/drivers/usb/serial/xr_serial.c
> +++ b/drivers/usb/serial/xr_serial.c
> @@ -495,7 +495,7 @@ static int xr_tiocmset(struct tty_struct *tty,
> return xr_tiocmset_port(port, set, clear);
> }
>
> -static void xr_dtr_rts(struct usb_serial_port *port, int on)
> +static void xr_dtr_rts(struct usb_serial_port *port, bool on)
> {
> if (on)
> xr_tiocmset_port(port, TIOCM_DTR | TIOCM_RTS, 0);
> @@ -669,9 +669,9 @@ static void xr_set_flow_mode(struct tty_struct *tty,
> xr_uart_enable(port);
>
> if (C_BAUD(tty) == B0)
> - xr_dtr_rts(port, 0);
> + xr_dtr_rts(port, false);
> else if (old_termios && (old_termios->c_cflag & CBAUD) == B0)
> - xr_dtr_rts(port, 1);
> + xr_dtr_rts(port, true);
> }
>
> static void xr21v141x_set_line_settings(struct tty_struct *tty,
> diff --git a/include/linux/tty_port.h b/include/linux/tty_port.h
> index cf098459cb01..c44e489de0ff 100644
> --- a/include/linux/tty_port.h
> +++ b/include/linux/tty_port.h
> @@ -16,7 +16,7 @@ struct tty_struct;
> /**
> * struct tty_port_operations -- operations on tty_port
> * @carrier_raised: return true if the carrier is raised on @port
> - * @dtr_rts: raise the DTR line if @raise is nonzero, otherwise lower DTR
> + * @dtr_rts: raise the DTR line if @raise is true, otherwise lower DTR
> * @shutdown: called when the last close completes or a hangup finishes IFF the
> * port was initialized. Do not use to free resources. Turn off the device
> * only. Called under the port mutex to serialize against @activate and
> @@ -32,7 +32,7 @@ struct tty_struct;
> */
> struct tty_port_operations {
> bool (*carrier_raised)(struct tty_port *port);
> - void (*dtr_rts)(struct tty_port *port, int raise);
> + void (*dtr_rts)(struct tty_port *port, bool raise);
> void (*shutdown)(struct tty_port *port);
> int (*activate)(struct tty_port *port, struct tty_struct *tty);
> void (*destruct)(struct tty_port *port);
> diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
> index dc7f90522b42..c597357853d9 100644
> --- a/include/linux/usb/serial.h
> +++ b/include/linux/usb/serial.h
> @@ -292,7 +292,7 @@ struct usb_serial_driver {
> struct serial_icounter_struct *icount);
> /* Called by the tty layer for port level work. There may or may not
> be an attached tty at this point */
> - void (*dtr_rts)(struct usb_serial_port *port, int on);
> + void (*dtr_rts)(struct usb_serial_port *port, bool on);
> bool (*carrier_raised)(struct usb_serial_port *port);
> /* Called by the usb serial hooks to allow the user to rework the
> termios state */
> --
> 2.30.2
>