mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 09:41:54 +09:00
staging: rts5208: Removed unnecessary return variable
This patch removes unnecessary return variables in switch statements.
This was done with Coccinelle:
@@ local idexpression ret; expression e1,e2; identifier label;
@@
switch ( ... ) {
case label : ...
- ret = e1;
- break;
+ return e1;
... default: ...
- ret = e2;
+ return e2;
... }
... when != ret
- return ret;
@@ type T; identifier x; @@
- T x;
... when != x
Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
22d2666b7c
commit
fdb78b64a7
@@ -1931,20 +1931,15 @@ static int rw_mem_cmd_buf(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
||||
|
||||
static int suit_cmd(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
||||
{
|
||||
int result;
|
||||
|
||||
switch (srb->cmnd[3]) {
|
||||
case INIT_BATCHCMD:
|
||||
case ADD_BATCHCMD:
|
||||
case SEND_BATCHCMD:
|
||||
case GET_BATCHRSP:
|
||||
result = rw_mem_cmd_buf(srb, chip);
|
||||
break;
|
||||
return rw_mem_cmd_buf(srb, chip);
|
||||
default:
|
||||
result = TRANSPORT_ERROR;
|
||||
return TRANSPORT_ERROR;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static int read_phy_register(struct scsi_cmnd *srb, struct rtsx_chip *chip)
|
||||
|
||||
Reference in New Issue
Block a user