diff options
author | Bhaktipriya Shridhar <bhaktipriya96@gmail.com> | 2016-02-21 13:05:20 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-11 22:09:09 -0800 |
commit | fdb78b64a7ba790e93a74f35778b431e71b5f48d (patch) | |
tree | 132a0baa626e48418e20686c4f6e3aab6ef75d8c /drivers/staging/rts5208 | |
parent | 22d2666b7c0e66cf71e57d4b8b9a3654a6417415 (diff) |
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>
Diffstat (limited to 'drivers/staging/rts5208')
-rw-r--r-- | drivers/staging/rts5208/rtsx_scsi.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/staging/rts5208/rtsx_scsi.c b/drivers/staging/rts5208/rtsx_scsi.c index 60871f3022b1..16284ca4cad0 100644 --- a/drivers/staging/rts5208/rtsx_scsi.c +++ b/drivers/staging/rts5208/rtsx_scsi.c @@ -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) |