2023-04-17 20:45:31

by Christophe JAILLET

[permalink] [raw]
Subject: [PATCH] nvmet-auth: remove some dead code

'status' is known to be 0 at the point.
And nvmet_auth_challenge() return a -E<ERROR_CODE> or 0.
So these lines of code should just be removed.

Signed-off-by: Christophe JAILLET <[email protected]>
---
The dead code became obvious after commit be2ada6d0ed0 ("nvmet-auth: fix
return value check in auth receive")
---
drivers/nvme/target/fabrics-cmd-auth.c | 9 ---------
1 file changed, 9 deletions(-)

diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
index 7970a7640e58..038032e46145 100644
--- a/drivers/nvme/target/fabrics-cmd-auth.c
+++ b/drivers/nvme/target/fabrics-cmd-auth.c
@@ -483,15 +483,6 @@ void nvmet_execute_auth_receive(struct nvmet_req *req)
status = NVME_SC_INTERNAL;
break;
}
- if (status) {
- req->sq->dhchap_status = status;
- nvmet_auth_failure1(req, d, al);
- pr_warn("ctrl %d qid %d: challenge status (%x)\n",
- ctrl->cntlid, req->sq->qid,
- req->sq->dhchap_status);
- status = 0;
- break;
- }
req->sq->dhchap_step = NVME_AUTH_DHCHAP_MESSAGE_REPLY;
break;
case NVME_AUTH_DHCHAP_MESSAGE_SUCCESS1:
--
2.34.1


2023-04-18 04:13:11

by Chaitanya Kulkarni

[permalink] [raw]
Subject: Re: [PATCH] nvmet-auth: remove some dead code

On 4/17/23 13:41, Christophe JAILLET wrote:
> 'status' is known to be 0 at the point.
> And nvmet_auth_challenge() return a -E<ERROR_CODE> or 0.
> So these lines of code should just be removed.
>
> Signed-off-by: Christophe JAILLET <[email protected]>
> ---
> The dead code became obvious after commit be2ada6d0ed0 ("nvmet-auth: fix
> return value check in auth receive")
> ---
>

Looks good.

Reviewed-by: Chaitanya Kulkarni <[email protected]>

-ck


2023-05-02 06:17:34

by Hannes Reinecke

[permalink] [raw]
Subject: Re: [PATCH] nvmet-auth: remove some dead code

On 4/17/23 22:41, Christophe JAILLET wrote:
> 'status' is known to be 0 at the point.
> And nvmet_auth_challenge() return a -E<ERROR_CODE> or 0.
> So these lines of code should just be removed.
>
> Signed-off-by: Christophe JAILLET <[email protected]>
> ---
> The dead code became obvious after commit be2ada6d0ed0 ("nvmet-auth: fix
> return value check in auth receive")
> ---
> drivers/nvme/target/fabrics-cmd-auth.c | 9 ---------
> 1 file changed, 9 deletions(-)
>
Reviewed-by: Hannes Reinecke <[email protected]>

Cheers,

Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
[email protected] +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman

2023-05-12 15:23:09

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] nvmet-auth: remove some dead code

Looks good:

Reviewed-by: Christoph Hellwig <[email protected]>

2023-05-25 18:15:32

by Keith Busch

[permalink] [raw]
Subject: Re: [PATCH] nvmet-auth: remove some dead code

Thanks, applied for nvme-6.5.