Linux USB
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: linux-usb@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Johan Hovold <johan@kernel.org>
Subject: [PATCH v2 10/12] USB: serial: digi_acceleport: clean up xfer buf length expression
Date: Tue, 23 Jun 2026 17:08:24 +0200	[thread overview]
Message-ID: <20260623150826.314727-11-johan@kernel.org> (raw)
In-Reply-To: <20260623150826.314727-1-johan@kernel.org>

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>
---
 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 8c21c669c1a2..f7630fdcdceb 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -445,7 +445,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;
 
@@ -871,7 +871,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 */
@@ -893,7 +893,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) {
@@ -901,7 +901,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;
-- 
2.53.0


  parent reply	other threads:[~2026-06-23 15:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 15:08 [PATCH v2 00/12] USB: serial: digi_acceleport: registration fix and cleanups Johan Hovold
2026-06-23 15:08 ` [PATCH v2 01/12] USB: serial: digi_acceleport: fix broken rx after throttle Johan Hovold
2026-06-23 15:08 ` [PATCH v2 02/12] USB: serial: digi_acceleport: fix port registration order Johan Hovold
2026-06-23 15:08 ` [PATCH v2 03/12] USB: serial: digi_acceleport: drop unused wait queue Johan Hovold
2026-06-23 15:08 ` [PATCH v2 04/12] USB: serial: digi_acceleport: always stop write urb on close Johan Hovold
2026-06-23 15:08 ` [PATCH v2 05/12] USB: serial: digi_acceleport: add oob port helper Johan Hovold
2026-06-23 15:08 ` [PATCH v2 06/12] USB: serial: digi_acceleport: clean up declarations and whitespace Johan Hovold
2026-06-23 15:08 ` [PATCH v2 07/12] USB: serial: digi_acceleport: drop redundant driver data sanity checks Johan Hovold
2026-06-23 15:08 ` [PATCH v2 08/12] USB: serial: digi_acceleport: stop OOB I/O when not in use Johan Hovold
2026-06-23 15:08 ` [PATCH v2 09/12] USB: serial: digi_acceleport: drop unused in-buf define Johan Hovold
2026-06-23 15:08 ` Johan Hovold [this message]
2026-06-23 15:08 ` [PATCH v2 11/12] USB: serial: digi_acceleport: clean up write completion Johan Hovold
2026-06-23 15:08 ` [PATCH v2 12/12] USB: serial: digi_acceleport: clean up inb command submission Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260623150826.314727-11-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox