mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
USB: serial: digi_acceleport: clean up xfer buf length expression
Add the missing space around operators in transfer-buffer length expressions to make the code more readable. Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
parent
6f04e550a6
commit
6016799d33
|
|
@ -452,7 +452,7 @@ static int digi_write_inb_command(struct usb_serial_port *port,
|
|||
/* len must be a multiple of 4 and small enough to */
|
||||
/* guarantee the write will send buffered data first, */
|
||||
/* so commands are in order with data and not split */
|
||||
len = min(count, port->bulk_out_size-2-priv->dp_out_buf_len);
|
||||
len = min(count, port->bulk_out_size - 2 - priv->dp_out_buf_len);
|
||||
if (len > 4)
|
||||
len &= ~3;
|
||||
|
||||
|
|
@ -878,7 +878,7 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|||
priv->dp_port_num, count);
|
||||
|
||||
/* copy user data (which can sleep) before getting spin lock */
|
||||
count = min(count, port->bulk_out_size-2);
|
||||
count = min(count, port->bulk_out_size - 2);
|
||||
count = min(64, count);
|
||||
|
||||
/* be sure only one write proceeds at a time */
|
||||
|
|
@ -900,7 +900,7 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|||
|
||||
/* allow space for any buffered data and for new data, up to */
|
||||
/* transfer buffer size - 2 (for command and length bytes) */
|
||||
new_len = min(count, port->bulk_out_size-2-priv->dp_out_buf_len);
|
||||
new_len = min(count, port->bulk_out_size - 2 - priv->dp_out_buf_len);
|
||||
data_len = new_len + priv->dp_out_buf_len;
|
||||
|
||||
if (data_len == 0) {
|
||||
|
|
@ -908,7 +908,7 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|||
return 0;
|
||||
}
|
||||
|
||||
port->write_urb->transfer_buffer_length = data_len+2;
|
||||
port->write_urb->transfer_buffer_length = data_len + 2;
|
||||
|
||||
*data++ = DIGI_CMD_SEND_DATA;
|
||||
*data++ = data_len;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user