diff mbox series

scsi: target: remove redundant assignment to variable 'ret'

Message ID 20200914023207.113792-1-jingxiangfeng@huawei.com
State New
Headers show
Series scsi: target: remove redundant assignment to variable 'ret' | expand

Commit Message

Jing Xiangfeng Sept. 14, 2020, 2:32 a.m. UTC
The variable ret has been initialized with a value '0'. The assignment
in switch-case is redundant. So remove it.

Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
---
 drivers/target/iscsi/iscsi_target.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Maurizio Lombardi Sept. 15, 2020, 11:58 a.m. UTC | #1
Dne 14. 09. 20 v 4:32 Jing Xiangfeng napsal(a):
> The variable ret has been initialized with a value '0'. The assignment
> in switch-case is redundant. So remove it.
> 
> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
> ---
>  drivers/target/iscsi/iscsi_target.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
> index cd045dc75a58..f5272ac18b16 100644
> --- a/drivers/target/iscsi/iscsi_target.c
> +++ b/drivers/target/iscsi/iscsi_target.c
> @@ -4516,7 +4516,6 @@ int iscsit_logout_post_handler(
>  			iscsit_logout_post_handler_closesession(conn);
>  			break;
>  		}
> -		ret = 0;
>  		break;
>  	case ISCSI_LOGOUT_REASON_CLOSE_CONNECTION:
>  		if (conn->cid == cmd->logout_cid) {
> @@ -4527,7 +4526,6 @@ int iscsit_logout_post_handler(
>  				iscsit_logout_post_handler_samecid(conn);
>  				break;
>  			}
> -			ret = 0;
>  		} else {
>  			switch (cmd->logout_response) {
>  			case ISCSI_LOGOUT_SUCCESS:
> 

Looks ok to me.

Reviewed-by: Maurizio Lombardi <mlombard@redhat.com>
Martin K. Petersen Sept. 15, 2020, 10:06 p.m. UTC | #2
Jing,

> The variable ret has been initialized with a value '0'. The assignment

> in switch-case is redundant. So remove it.


Applied to 5.10/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering
Martin K. Petersen Sept. 22, 2020, 3:56 a.m. UTC | #3
On Mon, 14 Sep 2020 10:32:07 +0800, Jing Xiangfeng wrote:

> The variable ret has been initialized with a value '0'. The assignment
> in switch-case is redundant. So remove it.

Applied to 5.10/scsi-queue, thanks!

[1/1] scsi: target: Remove redundant assignment to variable 'ret'
      https://git.kernel.org/mkp/scsi/c/1c370903d12d
diff mbox series

Patch

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index cd045dc75a58..f5272ac18b16 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -4516,7 +4516,6 @@  int iscsit_logout_post_handler(
 			iscsit_logout_post_handler_closesession(conn);
 			break;
 		}
-		ret = 0;
 		break;
 	case ISCSI_LOGOUT_REASON_CLOSE_CONNECTION:
 		if (conn->cid == cmd->logout_cid) {
@@ -4527,7 +4526,6 @@  int iscsit_logout_post_handler(
 				iscsit_logout_post_handler_samecid(conn);
 				break;
 			}
-			ret = 0;
 		} else {
 			switch (cmd->logout_response) {
 			case ISCSI_LOGOUT_SUCCESS: