hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/usb/serial/digi_acceleport.c
....@@ -546,9 +546,9 @@
546546 ret = usb_submit_urb(oob_port->write_urb, GFP_ATOMIC);
547547 if (ret == 0) {
548548 oob_priv->dp_write_urb_in_use = 1;
549
- port_priv->dp_modem_signals =
550
- (port_priv->dp_modem_signals&~(TIOCM_DTR|TIOCM_RTS))
551
- | (modem_signals&(TIOCM_DTR|TIOCM_RTS));
549
+ port_priv->dp_modem_signals &= ~(TIOCM_DTR | TIOCM_RTS);
550
+ port_priv->dp_modem_signals |=
551
+ modem_signals & (TIOCM_DTR | TIOCM_RTS);
552552 }
553553 spin_unlock(&port_priv->dp_port_lock);
554554 spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags);
....@@ -717,9 +717,9 @@
717717 /* set parity */
718718 tty->termios.c_cflag &= ~CMSPAR;
719719
720
- if ((cflag&(PARENB|PARODD)) != (old_cflag&(PARENB|PARODD))) {
721
- if (cflag&PARENB) {
722
- if (cflag&PARODD)
720
+ if ((cflag & (PARENB | PARODD)) != (old_cflag & (PARENB | PARODD))) {
721
+ if (cflag & PARENB) {
722
+ if (cflag & PARODD)
723723 arg = DIGI_PARITY_ODD;
724724 else
725725 arg = DIGI_PARITY_EVEN;
....@@ -732,9 +732,9 @@
732732 buf[i++] = 0;
733733 }
734734 /* set word size */
735
- if ((cflag&CSIZE) != (old_cflag&CSIZE)) {
735
+ if ((cflag & CSIZE) != (old_cflag & CSIZE)) {
736736 arg = -1;
737
- switch (cflag&CSIZE) {
737
+ switch (cflag & CSIZE) {
738738 case CS5: arg = DIGI_WORD_SIZE_5; break;
739739 case CS6: arg = DIGI_WORD_SIZE_6; break;
740740 case CS7: arg = DIGI_WORD_SIZE_7; break;
....@@ -742,7 +742,7 @@
742742 default:
743743 dev_dbg(dev,
744744 "digi_set_termios: can't handle word size %d\n",
745
- (cflag&CSIZE));
745
+ cflag & CSIZE);
746746 break;
747747 }
748748
....@@ -756,9 +756,9 @@
756756 }
757757
758758 /* set stop bits */
759
- if ((cflag&CSTOPB) != (old_cflag&CSTOPB)) {
759
+ if ((cflag & CSTOPB) != (old_cflag & CSTOPB)) {
760760
761
- if ((cflag&CSTOPB))
761
+ if ((cflag & CSTOPB))
762762 arg = DIGI_STOP_BITS_2;
763763 else
764764 arg = DIGI_STOP_BITS_1;
....@@ -771,15 +771,15 @@
771771 }
772772
773773 /* set input flow control */
774
- if ((iflag&IXOFF) != (old_iflag&IXOFF)
775
- || (cflag&CRTSCTS) != (old_cflag&CRTSCTS)) {
774
+ if ((iflag & IXOFF) != (old_iflag & IXOFF) ||
775
+ (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
776776 arg = 0;
777
- if (iflag&IXOFF)
777
+ if (iflag & IXOFF)
778778 arg |= DIGI_INPUT_FLOW_CONTROL_XON_XOFF;
779779 else
780780 arg &= ~DIGI_INPUT_FLOW_CONTROL_XON_XOFF;
781781
782
- if (cflag&CRTSCTS) {
782
+ if (cflag & CRTSCTS) {
783783 arg |= DIGI_INPUT_FLOW_CONTROL_RTS;
784784
785785 /* On USB-4 it is necessary to assert RTS prior */
....@@ -799,19 +799,18 @@
799799 }
800800
801801 /* set output flow control */
802
- if ((iflag & IXON) != (old_iflag & IXON)
803
- || (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
802
+ if ((iflag & IXON) != (old_iflag & IXON) ||
803
+ (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
804804 arg = 0;
805805 if (iflag & IXON)
806806 arg |= DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF;
807807 else
808808 arg &= ~DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF;
809809
810
- if (cflag & CRTSCTS) {
810
+ if (cflag & CRTSCTS)
811811 arg |= DIGI_OUTPUT_FLOW_CONTROL_CTS;
812
- } else {
812
+ else
813813 arg &= ~DIGI_OUTPUT_FLOW_CONTROL_CTS;
814
- }
815814
816815 buf[i++] = DIGI_CMD_SET_OUTPUT_FLOW_CONTROL;
817816 buf[i++] = priv->dp_port_num;
....@@ -1062,7 +1061,7 @@
10621061 static void digi_dtr_rts(struct usb_serial_port *port, int on)
10631062 {
10641063 /* Adjust DTR and RTS */
1065
- digi_set_modem_signals(port, on * (TIOCM_DTR|TIOCM_RTS), 1);
1064
+ digi_set_modem_signals(port, on * (TIOCM_DTR | TIOCM_RTS), 1);
10661065 }
10671066
10681067 static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
....@@ -1450,7 +1449,7 @@
14501449 struct usb_serial_port *port = urb->context;
14511450 struct usb_serial *serial = port->serial;
14521451 struct tty_struct *tty;
1453
- struct digi_port *priv = usb_get_serial_port_data(port);
1452
+ struct digi_port *priv;
14541453 unsigned char *buf = urb->transfer_buffer;
14551454 int opcode, line, status, val;
14561455 unsigned long flags;