[PATCH] usb: storage: transport: Fix indentation typo in 'transport.c'

4 views
Skip to first unread message

Ren Xiao

unread,
Nov 16, 2023, 5:45:53 AM11/16/23
to hust-os-ker...@googlegroups.com, Ren Xiao
Removed excess spaces before the label at line 1063.

Adjusted the indentation of the switch-case code blocks which
start from line 1051 and line 1304.

Signed-off-by: Ren Xiao <u2021...@hust.edu.cn>
---
drivers/usb/storage/transport.c | 48 ++++++++++++++++-----------------
1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index 7449e379077a..88d9f839d809 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -1049,10 +1049,10 @@ int usb_stor_CB_transport(struct scsi_cmnd *srb, struct us_data *us)

/* The second byte & 0x0F should be 0x0 for good, otherwise error */
switch (us->iobuf[1] & 0x0F) {
- case 0x00:
- return USB_STOR_TRANSPORT_GOOD;
- case 0x01:
- goto Failed;
+ case 0x00:
+ return USB_STOR_TRANSPORT_GOOD;
+ case 0x01:
+ goto Failed;
}
return USB_STOR_TRANSPORT_ERROR;

@@ -1060,7 +1060,7 @@ int usb_stor_CB_transport(struct scsi_cmnd *srb, struct us_data *us)
* the CBI spec requires that the bulk pipe must be cleared
* following any data-in/out command failure (section 2.4.3.1.3)
*/
- Failed:
+Failed:
if (pipe)
usb_stor_clear_halt(us, pipe);
return USB_STOR_TRANSPORT_FAILED;
@@ -1302,28 +1302,28 @@ int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us)

/* based on the status code, we report good or bad */
switch (bcs->Status) {
- case US_BULK_STAT_OK:
- /* device babbled -- return fake sense data */
- if (fake_sense) {
- memcpy(srb->sense_buffer,
- usb_stor_sense_invalidCDB,
- sizeof(usb_stor_sense_invalidCDB));
- return USB_STOR_TRANSPORT_NO_SENSE;
- }
+ case US_BULK_STAT_OK:
+ /* device babbled -- return fake sense data */
+ if (fake_sense) {
+ memcpy(srb->sense_buffer,
+ usb_stor_sense_invalidCDB,
+ sizeof(usb_stor_sense_invalidCDB));
+ return USB_STOR_TRANSPORT_NO_SENSE;
+ }

- /* command good -- note that data could be short */
- return USB_STOR_TRANSPORT_GOOD;
+ /* command good -- note that data could be short */
+ return USB_STOR_TRANSPORT_GOOD;

- case US_BULK_STAT_FAIL:
- /* command failed */
- return USB_STOR_TRANSPORT_FAILED;
+ case US_BULK_STAT_FAIL:
+ /* command failed */
+ return USB_STOR_TRANSPORT_FAILED;

- case US_BULK_STAT_PHASE:
- /*
- * phase error -- note that a transport reset will be
- * invoked by the invoke_transport() function
- */
- return USB_STOR_TRANSPORT_ERROR;
+ case US_BULK_STAT_PHASE:
+ /*
+ * phase error -- note that a transport reset will be
+ * invoked by the invoke_transport() function
+ */
+ return USB_STOR_TRANSPORT_ERROR;
}

/* we should never get here, but if we do, we're in trouble */
--
2.34.1

ktest...@126.com

unread,
Nov 16, 2023, 5:53:40 AM11/16/23
to u2021...@hust.edu.cn, u2021...@hust.edu.cn, hust-os-ker...@googlegroups.com
Hi, Ren Xiao
This email is automatically replied by KTestRobot(version 1.0). Please do not reply to this email.
If you have any questions or suggestions about KTestRobot, please contact Lishuchang <U2020...@hust.edu.cn>

--- Changed Paths ---
drivers/usb/storage/transport.c

--- Log Message ---
Removed excess spaces before the label at line 1063.

Adjusted the indentation of the switch-case code blocks which
start from line 1051 and line 1304.

--- Test Result ---
*** CheckPatch PASS ***
*** ApplyTolinux-next PASS ***
*** ApplyTomainline PASS ***
*** BuildCheck PASS ***
*** CheckCocci PASS ***
*** CheckCppcheck PASS ***

--
KTestRobot(version 1.0)

Ren Xiao

unread,
Nov 18, 2023, 1:24:30 AM11/18/23
to hust-os-ker...@googlegroups.com, Ren Xiao
Removed excess spaces before the label at line 1063.

Signed-off-by: Ren Xiao <u2021...@hust.edu.cn>
---
drivers/usb/storage/transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index 7449e379077a..8f236854c83b 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -1060,7 +1060,7 @@ int usb_stor_CB_transport(struct scsi_cmnd *srb, struct us_data *us)
* the CBI spec requires that the bulk pipe must be cleared
* following any data-in/out command failure (section 2.4.3.1.3)
*/
- Failed:
+Failed:
if (pipe)
usb_stor_clear_halt(us, pipe);
return USB_STOR_TRANSPORT_FAILED;
--
2.34.1

Dan Carpenter

unread,
Nov 20, 2023, 8:02:34 AM11/20/23
to Ren Xiao, hust-os-ker...@googlegroups.com
On Sat, Nov 18, 2023 at 01:24:08AM -0500, Ren Xiao wrote:
> Removed excess spaces before the label at line 1063.
>
> Signed-off-by: Ren Xiao <u2021...@hust.edu.cn>
> ---
> drivers/usb/storage/transport.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
> index 7449e379077a..8f236854c83b 100644
> --- a/drivers/usb/storage/transport.c
> +++ b/drivers/usb/storage/transport.c
> @@ -1060,7 +1060,7 @@ int usb_stor_CB_transport(struct scsi_cmnd *srb, struct us_data *us)
> * the CBI spec requires that the bulk pipe must be cleared
> * following any data-in/out command failure (section 2.4.3.1.3)
> */
> - Failed:
> +Failed:

Whoever wrote this did it deliberately. It's not proper style but it's
fine. Just leave it. Who cares?

> if (pipe)
> usb_stor_clear_halt(us, pipe);
> return USB_STOR_TRANSPORT_FAILED;

regards,
dan carpenter

Ren Xiao

unread,
Nov 23, 2023, 1:35:14 AM11/23/23
to Alan Stern, Greg Kroah-Hartman, hust-os-ker...@googlegroups.com, Ren Xiao, Dongliang Mu, linu...@vger.kernel.org, usb-s...@lists.one-eyed-alien.net, linux-...@vger.kernel.org
Removed excess spaces before the label at line 1063.

Signed-off-by: Ren Xiao <u2021...@hust.edu.cn>
Reviewed-by: Dongliang Mu <dz...@hust.edu.cn>
---
drivers/usb/storage/transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index 7449e379077a..8f236854c83b 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -1060,7 +1060,7 @@ int usb_stor_CB_transport(struct scsi_cmnd *srb, struct us_data *us)
* the CBI spec requires that the bulk pipe must be cleared
* following any data-in/out command failure (section 2.4.3.1.3)
*/
- Failed:
+Failed:
if (pipe)
usb_stor_clear_halt(us, pipe);
return USB_STOR_TRANSPORT_FAILED;
--
2.34.1

Reply all
Reply to author
Forward
0 new messages