mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: xy521521@gmail.com
To: stern@rowland.harvard.edu
Cc: Hongyu Xie <xiehongyu1@kylinos.cn>,
	gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	usb-storage@lists.one-eyed-alien.net,
	linux-kernel@vger.kernel.org
Subject: [PATCH v3 2/2] usb-storage: ene_ub6250: fix coding style issues in the timeout code
Date: Thu,  1 Oct 2026 20:31:35 +0800	[thread overview]
Message-ID: <20261001123135.38831-3-xy521521@gmail.com> (raw)
In-Reply-To: <20261001123135.38831-1-xy521521@gmail.com>

From: Hongyu Xie <xiehongyu1@kylinos.cn>

Fix the continuation-line alignment of the code added for the bounded
probe-time transfers and rename the fDir parameter of
ene_send_scsi_cmd[_timeout]() to fdir, as flagged by checkpatch.

No functional changes intended.

Signed-off-by: Hongyu Xie <xiehongyu1@kylinos.cn>
---
 drivers/usb/storage/ene_ub6250.c | 34 ++++++++++++++++----------------
 drivers/usb/storage/transport.c  |  9 +++++----
 drivers/usb/storage/transport.h  |  6 ++++--
 3 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6250.c
index 109336bd7e30..276764a66774 100644
--- a/drivers/usb/storage/ene_ub6250.c
+++ b/drivers/usb/storage/ene_ub6250.c
@@ -494,7 +494,7 @@ static void ene_ub6250_info_destructor(void *extra)
 	kfree(info->bbuf);
 }
 
-static int ene_send_scsi_cmd_timeout(struct us_data *us, u8 fDir, void *buf,
+static int ene_send_scsi_cmd_timeout(struct us_data *us, u8 fdir, void *buf,
 				     int use_sg, int timeout)
 {
 	struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf;
@@ -508,17 +508,17 @@ static int ene_send_scsi_cmd_timeout(struct us_data *us, u8 fDir, void *buf,
 	/* usb_stor_dbg(us, "transport --- ene_send_scsi_cmd\n"); */
 	/* send cmd to out endpoint */
 	result = usb_stor_bulk_transfer_buf_timeout(us, us->send_bulk_pipe,
-					    bcb, US_BULK_CB_WRAP_LEN, NULL,
-					    timeout);
+						    bcb, US_BULK_CB_WRAP_LEN,
+						    NULL, timeout);
 	if (result != USB_STOR_XFER_GOOD) {
 		usb_stor_dbg(us, "send cmd to out endpoint fail ---\n");
 		return USB_STOR_TRANSPORT_ERROR;
 	}
 
 	if (buf) {
-		unsigned int pipe = fDir;
+		unsigned int pipe = fdir;
 
-		if (fDir  == FDIR_READ)
+		if (fdir == FDIR_READ)
 			pipe = us->recv_bulk_pipe;
 		else
 			pipe = us->send_bulk_pipe;
@@ -528,8 +528,8 @@ static int ene_send_scsi_cmd_timeout(struct us_data *us, u8 fDir, void *buf,
 			result = usb_stor_bulk_srb(us, pipe, us->srb);
 		} else if (timeout) {
 			result = usb_stor_bulk_transfer_buf_timeout(us, pipe,
-					buf, transfer_length, &partial,
-					timeout);
+								    buf, transfer_length, &partial,
+								    timeout);
 		} else {
 			result = usb_stor_bulk_transfer_sg(us, pipe, buf,
 						transfer_length, 0, &partial);
@@ -542,24 +542,24 @@ static int ene_send_scsi_cmd_timeout(struct us_data *us, u8 fDir, void *buf,
 
 	/* Get CSW for device status */
 	result = usb_stor_bulk_transfer_buf_timeout(us, us->recv_bulk_pipe,
-					    bcs, US_BULK_CS_WRAP_LEN, &cswlen,
-					    timeout);
+						    bcs, US_BULK_CS_WRAP_LEN,
+						    &cswlen, timeout);
 
 	if (result == USB_STOR_XFER_SHORT && cswlen == 0) {
 		usb_stor_dbg(us, "Received 0-length CSW; retrying...\n");
 		result = usb_stor_bulk_transfer_buf_timeout(us,
-					    us->recv_bulk_pipe, bcs,
-					    US_BULK_CS_WRAP_LEN, &cswlen,
-					    timeout);
+							    us->recv_bulk_pipe, bcs,
+							    US_BULK_CS_WRAP_LEN, &cswlen,
+							    timeout);
 	}
 
 	if (result == USB_STOR_XFER_STALLED) {
 		/* get the status again */
 		usb_stor_dbg(us, "Attempting to get CSW (2nd try)...\n");
 		result = usb_stor_bulk_transfer_buf_timeout(us,
-						us->recv_bulk_pipe, bcs,
-						US_BULK_CS_WRAP_LEN, NULL,
-						timeout);
+							    us->recv_bulk_pipe, bcs,
+							    US_BULK_CS_WRAP_LEN, NULL,
+							    timeout);
 	}
 
 	if (result != USB_STOR_XFER_GOOD)
@@ -589,9 +589,9 @@ static int ene_send_scsi_cmd_timeout(struct us_data *us, u8 fDir, void *buf,
  * Unbounded variant for command-path callers: the command's abort
  * machinery terminates usb_stor_msg_common()'s wait if the device dies.
  */
-static int ene_send_scsi_cmd(struct us_data *us, u8 fDir, void *buf, int use_sg)
+static int ene_send_scsi_cmd(struct us_data *us, u8 fdir, void *buf, int use_sg)
 {
-	return ene_send_scsi_cmd_timeout(us, fDir, buf, use_sg, 0);
+	return ene_send_scsi_cmd_timeout(us, fdir, buf, use_sg, 0);
 }
 
 static int do_scsi_request_sense(struct us_data *us, struct scsi_cmnd *srb)
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index c586d2021b7e..89619010d665 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -388,8 +388,8 @@ static int usb_stor_intr_transfer(struct us_data *us, void *buf,
  * machinery to terminate the wait.
  */
 int usb_stor_bulk_transfer_buf_timeout(struct us_data *us, unsigned int pipe,
-		void *buf, unsigned int length, unsigned int *act_len,
-		int timeout)
+				       void *buf, unsigned int length,
+				       unsigned int *act_len, int timeout)
 {
 	int result;
 
@@ -412,10 +412,11 @@ EXPORT_SYMBOL_GPL(usb_stor_bulk_transfer_buf_timeout);
  * Same as usb_stor_bulk_transfer_buf_timeout() with an unbounded wait.
  */
 int usb_stor_bulk_transfer_buf(struct us_data *us, unsigned int pipe,
-		void *buf, unsigned int length, unsigned int *act_len)
+			       void *buf, unsigned int length,
+			       unsigned int *act_len)
 {
 	return usb_stor_bulk_transfer_buf_timeout(us, pipe, buf, length,
-			act_len, 0);
+						  act_len, 0);
 }
 EXPORT_SYMBOL_GPL(usb_stor_bulk_transfer_buf);
 
diff --git a/drivers/usb/storage/transport.h b/drivers/usb/storage/transport.h
index dc0442efc24d..361dbd77f15e 100644
--- a/drivers/usb/storage/transport.h
+++ b/drivers/usb/storage/transport.h
@@ -78,8 +78,10 @@ extern int usb_stor_ctrl_transfer(struct us_data *us, unsigned int pipe,
 		u8 request, u8 requesttype, u16 value, u16 index,
 		void *data, u16 size);
 extern int usb_stor_bulk_transfer_buf_timeout(struct us_data *us,
-		unsigned int pipe, void *buf, unsigned int length,
-		unsigned int *act_len, int timeout);
+					      unsigned int pipe, void *buf,
+					      unsigned int length,
+					      unsigned int *act_len,
+					      int timeout);
 extern int usb_stor_bulk_transfer_buf(struct us_data *us, unsigned int pipe,
 		void *buf, unsigned int length, unsigned int *act_len);
 extern int usb_stor_bulk_transfer_sg(struct us_data *us, unsigned int pipe,
-- 
2.32.0


      parent reply	other threads:[~2026-10-01 12:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 12:31 [PATCH v3 0/2] usb-storage: ene_ub6250: don't let the card-type probe hang forever xy521521
2026-10-01 12:31 ` [PATCH v3 1/2] " xy521521
2026-10-01 12:31 ` xy521521 [this message]

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=20261001123135.38831-3-xy521521@gmail.com \
    --to=xy521521@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=usb-storage@lists.one-eyed-alien.net \
    --cc=xiehongyu1@kylinos.cn \
    /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

all inboxes | Powered by JetHome®