* [1/2] USB: serial: digi_acceleport: clean up modem-control handling
@ 2019-04-18 16:20 ` Johan Hovold
0 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2019-04-18 16:20 UTC (permalink / raw)
To: linux-usb; +Cc: Johan Hovold
Clean up modem-control handling somewhat by adding missing whitespace
around operators and splitting a long statement in two.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/usb/serial/digi_acceleport.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index e7f244cf2c07..4699e114f617 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -569,9 +569,9 @@ static int digi_set_modem_signals(struct usb_serial_port *port,
ret = usb_submit_urb(oob_port->write_urb, GFP_ATOMIC);
if (ret == 0) {
oob_priv->dp_write_urb_in_use = 1;
- port_priv->dp_modem_signals =
- (port_priv->dp_modem_signals&~(TIOCM_DTR|TIOCM_RTS))
- | (modem_signals&(TIOCM_DTR|TIOCM_RTS));
+ port_priv->dp_modem_signals &= ~(TIOCM_DTR | TIOCM_RTS);
+ port_priv->dp_modem_signals |=
+ modem_signals & (TIOCM_DTR | TIOCM_RTS);
}
spin_unlock(&port_priv->dp_port_lock);
spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags);
@@ -1084,7 +1084,7 @@ static int digi_chars_in_buffer(struct tty_struct *tty)
static void digi_dtr_rts(struct usb_serial_port *port, int 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), 1);
}
static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 1/2] USB: serial: digi_acceleport: clean up modem-control handling
@ 2019-04-18 16:20 ` Johan Hovold
0 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2019-04-18 16:20 UTC (permalink / raw)
To: linux-usb; +Cc: Johan Hovold
Clean up modem-control handling somewhat by adding missing whitespace
around operators and splitting a long statement in two.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/usb/serial/digi_acceleport.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index e7f244cf2c07..4699e114f617 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -569,9 +569,9 @@ static int digi_set_modem_signals(struct usb_serial_port *port,
ret = usb_submit_urb(oob_port->write_urb, GFP_ATOMIC);
if (ret == 0) {
oob_priv->dp_write_urb_in_use = 1;
- port_priv->dp_modem_signals =
- (port_priv->dp_modem_signals&~(TIOCM_DTR|TIOCM_RTS))
- | (modem_signals&(TIOCM_DTR|TIOCM_RTS));
+ port_priv->dp_modem_signals &= ~(TIOCM_DTR | TIOCM_RTS);
+ port_priv->dp_modem_signals |=
+ modem_signals & (TIOCM_DTR | TIOCM_RTS);
}
spin_unlock(&port_priv->dp_port_lock);
spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags);
@@ -1084,7 +1084,7 @@ static int digi_chars_in_buffer(struct tty_struct *tty)
static void digi_dtr_rts(struct usb_serial_port *port, int 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), 1);
}
static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
--
2.21.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [2/2] USB: serial: digi_acceleport: clean up set_termios
@ 2019-04-18 16:20 ` Johan Hovold
0 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2019-04-18 16:20 UTC (permalink / raw)
To: linux-usb; +Cc: Johan Hovold
Clean up set_termios() by adding missing white space around operators
and making a couple of continuation lines more readable.
Also drop a couple of redundant braces.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/usb/serial/digi_acceleport.c | 33 ++++++++++++++--------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 4699e114f617..578ebdd86520 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -740,9 +740,9 @@ static void digi_set_termios(struct tty_struct *tty,
/* set parity */
tty->termios.c_cflag &= ~CMSPAR;
- if ((cflag&(PARENB|PARODD)) != (old_cflag&(PARENB|PARODD))) {
- if (cflag&PARENB) {
- if (cflag&PARODD)
+ if ((cflag & (PARENB | PARODD)) != (old_cflag & (PARENB | PARODD))) {
+ if (cflag & PARENB) {
+ if (cflag & PARODD)
arg = DIGI_PARITY_ODD;
else
arg = DIGI_PARITY_EVEN;
@@ -755,9 +755,9 @@ static void digi_set_termios(struct tty_struct *tty,
buf[i++] = 0;
}
/* set word size */
- if ((cflag&CSIZE) != (old_cflag&CSIZE)) {
+ if ((cflag & CSIZE) != (old_cflag & CSIZE)) {
arg = -1;
- switch (cflag&CSIZE) {
+ switch (cflag & CSIZE) {
case CS5: arg = DIGI_WORD_SIZE_5; break;
case CS6: arg = DIGI_WORD_SIZE_6; break;
case CS7: arg = DIGI_WORD_SIZE_7; break;
@@ -765,7 +765,7 @@ static void digi_set_termios(struct tty_struct *tty,
default:
dev_dbg(dev,
"digi_set_termios: can't handle word size %d\n",
- (cflag&CSIZE));
+ cflag & CSIZE);
break;
}
@@ -779,9 +779,9 @@ static void digi_set_termios(struct tty_struct *tty,
}
/* set stop bits */
- if ((cflag&CSTOPB) != (old_cflag&CSTOPB)) {
+ if ((cflag & CSTOPB) != (old_cflag & CSTOPB)) {
- if ((cflag&CSTOPB))
+ if ((cflag & CSTOPB))
arg = DIGI_STOP_BITS_2;
else
arg = DIGI_STOP_BITS_1;
@@ -794,15 +794,15 @@ static void digi_set_termios(struct tty_struct *tty,
}
/* set input flow control */
- if ((iflag&IXOFF) != (old_iflag&IXOFF)
- || (cflag&CRTSCTS) != (old_cflag&CRTSCTS)) {
+ if ((iflag & IXOFF) != (old_iflag & IXOFF) ||
+ (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
arg = 0;
- if (iflag&IXOFF)
+ if (iflag & IXOFF)
arg |= DIGI_INPUT_FLOW_CONTROL_XON_XOFF;
else
arg &= ~DIGI_INPUT_FLOW_CONTROL_XON_XOFF;
- if (cflag&CRTSCTS) {
+ if (cflag & CRTSCTS) {
arg |= DIGI_INPUT_FLOW_CONTROL_RTS;
/* On USB-4 it is necessary to assert RTS prior */
@@ -822,19 +822,18 @@ static void digi_set_termios(struct tty_struct *tty,
}
/* set output flow control */
- if ((iflag & IXON) != (old_iflag & IXON)
- || (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
+ if ((iflag & IXON) != (old_iflag & IXON) ||
+ (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
arg = 0;
if (iflag & IXON)
arg |= DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF;
else
arg &= ~DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF;
- if (cflag & CRTSCTS) {
+ if (cflag & CRTSCTS)
arg |= DIGI_OUTPUT_FLOW_CONTROL_CTS;
- } else {
+ else
arg &= ~DIGI_OUTPUT_FLOW_CONTROL_CTS;
- }
buf[i++] = DIGI_CMD_SET_OUTPUT_FLOW_CONTROL;
buf[i++] = priv->dp_port_num;
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2] USB: serial: digi_acceleport: clean up set_termios
@ 2019-04-18 16:20 ` Johan Hovold
0 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2019-04-18 16:20 UTC (permalink / raw)
To: linux-usb; +Cc: Johan Hovold
Clean up set_termios() by adding missing white space around operators
and making a couple of continuation lines more readable.
Also drop a couple of redundant braces.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/usb/serial/digi_acceleport.c | 33 ++++++++++++++--------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 4699e114f617..578ebdd86520 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -740,9 +740,9 @@ static void digi_set_termios(struct tty_struct *tty,
/* set parity */
tty->termios.c_cflag &= ~CMSPAR;
- if ((cflag&(PARENB|PARODD)) != (old_cflag&(PARENB|PARODD))) {
- if (cflag&PARENB) {
- if (cflag&PARODD)
+ if ((cflag & (PARENB | PARODD)) != (old_cflag & (PARENB | PARODD))) {
+ if (cflag & PARENB) {
+ if (cflag & PARODD)
arg = DIGI_PARITY_ODD;
else
arg = DIGI_PARITY_EVEN;
@@ -755,9 +755,9 @@ static void digi_set_termios(struct tty_struct *tty,
buf[i++] = 0;
}
/* set word size */
- if ((cflag&CSIZE) != (old_cflag&CSIZE)) {
+ if ((cflag & CSIZE) != (old_cflag & CSIZE)) {
arg = -1;
- switch (cflag&CSIZE) {
+ switch (cflag & CSIZE) {
case CS5: arg = DIGI_WORD_SIZE_5; break;
case CS6: arg = DIGI_WORD_SIZE_6; break;
case CS7: arg = DIGI_WORD_SIZE_7; break;
@@ -765,7 +765,7 @@ static void digi_set_termios(struct tty_struct *tty,
default:
dev_dbg(dev,
"digi_set_termios: can't handle word size %d\n",
- (cflag&CSIZE));
+ cflag & CSIZE);
break;
}
@@ -779,9 +779,9 @@ static void digi_set_termios(struct tty_struct *tty,
}
/* set stop bits */
- if ((cflag&CSTOPB) != (old_cflag&CSTOPB)) {
+ if ((cflag & CSTOPB) != (old_cflag & CSTOPB)) {
- if ((cflag&CSTOPB))
+ if ((cflag & CSTOPB))
arg = DIGI_STOP_BITS_2;
else
arg = DIGI_STOP_BITS_1;
@@ -794,15 +794,15 @@ static void digi_set_termios(struct tty_struct *tty,
}
/* set input flow control */
- if ((iflag&IXOFF) != (old_iflag&IXOFF)
- || (cflag&CRTSCTS) != (old_cflag&CRTSCTS)) {
+ if ((iflag & IXOFF) != (old_iflag & IXOFF) ||
+ (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
arg = 0;
- if (iflag&IXOFF)
+ if (iflag & IXOFF)
arg |= DIGI_INPUT_FLOW_CONTROL_XON_XOFF;
else
arg &= ~DIGI_INPUT_FLOW_CONTROL_XON_XOFF;
- if (cflag&CRTSCTS) {
+ if (cflag & CRTSCTS) {
arg |= DIGI_INPUT_FLOW_CONTROL_RTS;
/* On USB-4 it is necessary to assert RTS prior */
@@ -822,19 +822,18 @@ static void digi_set_termios(struct tty_struct *tty,
}
/* set output flow control */
- if ((iflag & IXON) != (old_iflag & IXON)
- || (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
+ if ((iflag & IXON) != (old_iflag & IXON) ||
+ (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
arg = 0;
if (iflag & IXON)
arg |= DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF;
else
arg &= ~DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF;
- if (cflag & CRTSCTS) {
+ if (cflag & CRTSCTS)
arg |= DIGI_OUTPUT_FLOW_CONTROL_CTS;
- } else {
+ else
arg &= ~DIGI_OUTPUT_FLOW_CONTROL_CTS;
- }
buf[i++] = DIGI_CMD_SET_OUTPUT_FLOW_CONTROL;
buf[i++] = priv->dp_port_num;
--
2.21.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [1/2] USB: serial: digi_acceleport: clean up modem-control handling
@ 2019-04-19 8:27 ` Greg KH
0 siblings, 0 replies; 10+ messages in thread
From: Greg Kroah-Hartman @ 2019-04-19 8:27 UTC (permalink / raw)
To: Johan Hovold; +Cc: linux-usb
On Thu, Apr 18, 2019 at 06:20:19PM +0200, Johan Hovold wrote:
> Clean up modem-control handling somewhat by adding missing whitespace
> around operators and splitting a long statement in two.
>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
> drivers/usb/serial/digi_acceleport.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] USB: serial: digi_acceleport: clean up modem-control handling
@ 2019-04-19 8:27 ` Greg KH
0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2019-04-19 8:27 UTC (permalink / raw)
To: Johan Hovold; +Cc: linux-usb
On Thu, Apr 18, 2019 at 06:20:19PM +0200, Johan Hovold wrote:
> Clean up modem-control handling somewhat by adding missing whitespace
> around operators and splitting a long statement in two.
>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
> drivers/usb/serial/digi_acceleport.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [2/2] USB: serial: digi_acceleport: clean up set_termios
@ 2019-04-19 8:27 ` Greg KH
0 siblings, 0 replies; 10+ messages in thread
From: Greg Kroah-Hartman @ 2019-04-19 8:27 UTC (permalink / raw)
To: Johan Hovold; +Cc: linux-usb
On Thu, Apr 18, 2019 at 06:20:20PM +0200, Johan Hovold wrote:
> Clean up set_termios() by adding missing white space around operators
> and making a couple of continuation lines more readable.
>
> Also drop a couple of redundant braces.
>
> Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] USB: serial: digi_acceleport: clean up set_termios
@ 2019-04-19 8:27 ` Greg KH
0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2019-04-19 8:27 UTC (permalink / raw)
To: Johan Hovold; +Cc: linux-usb
On Thu, Apr 18, 2019 at 06:20:20PM +0200, Johan Hovold wrote:
> Clean up set_termios() by adding missing white space around operators
> and making a couple of continuation lines more readable.
>
> Also drop a couple of redundant braces.
>
> Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [2/2] USB: serial: digi_acceleport: clean up set_termios
@ 2019-04-21 12:26 ` Johan Hovold
0 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2019-04-21 12:26 UTC (permalink / raw)
To: Greg KH; +Cc: Johan Hovold, linux-usb
On Fri, Apr 19, 2019 at 10:27:43AM +0200, Greg Kroah-Hartman wrote:
> On Thu, Apr 18, 2019 at 06:20:20PM +0200, Johan Hovold wrote:
> > Clean up set_termios() by adding missing white space around operators
> > and making a couple of continuation lines more readable.
> >
> > Also drop a couple of redundant braces.
> >
> > Signed-off-by: Johan Hovold <johan@kernel.org>
>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Thanks for reviewing. Both now applied.
Johan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] USB: serial: digi_acceleport: clean up set_termios
@ 2019-04-21 12:26 ` Johan Hovold
0 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2019-04-21 12:26 UTC (permalink / raw)
To: Greg KH; +Cc: Johan Hovold, linux-usb
On Fri, Apr 19, 2019 at 10:27:43AM +0200, Greg Kroah-Hartman wrote:
> On Thu, Apr 18, 2019 at 06:20:20PM +0200, Johan Hovold wrote:
> > Clean up set_termios() by adding missing white space around operators
> > and making a couple of continuation lines more readable.
> >
> > Also drop a couple of redundant braces.
> >
> > Signed-off-by: Johan Hovold <johan@kernel.org>
>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Thanks for reviewing. Both now applied.
Johan
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2019-04-21 12:26 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-21 12:26 [2/2] USB: serial: digi_acceleport: clean up set_termios Johan Hovold
2019-04-21 12:26 ` [PATCH 2/2] " Johan Hovold
-- strict thread matches above, loose matches on Subject: below --
2019-04-19 8:27 [2/2] " Greg Kroah-Hartman
2019-04-19 8:27 ` [PATCH 2/2] " Greg KH
2019-04-19 8:27 [1/2] USB: serial: digi_acceleport: clean up modem-control handling Greg Kroah-Hartman
2019-04-19 8:27 ` [PATCH 1/2] " Greg KH
2019-04-18 16:20 [2/2] USB: serial: digi_acceleport: clean up set_termios Johan Hovold
2019-04-18 16:20 ` [PATCH 2/2] " Johan Hovold
2019-04-18 16:20 [1/2] USB: serial: digi_acceleport: clean up modem-control handling Johan Hovold
2019-04-18 16:20 ` [PATCH 1/2] " Johan Hovold
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.