nvmet-auth: remove some dead code

Message ID e6f0e506459eaec9dad74946c1e01aac74874054.1681764032.git.christophe.jaillet@wanadoo.fr
State New
Headers
Series nvmet-auth: remove some dead code |

Commit Message

Christophe JAILLET April 17, 2023, 8:41 p.m. UTC
  '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 <christophe.jaillet@wanadoo.fr>
---
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(-)
  

Comments

Chaitanya Kulkarni April 18, 2023, 4:06 a.m. UTC | #1
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 <christophe.jaillet@wanadoo.fr>
> ---
> The dead code became obvious after commit be2ada6d0ed0 ("nvmet-auth: fix
> return value check in auth receive")
> ---
>

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck
  
Hannes Reinecke May 2, 2023, 6:04 a.m. UTC | #2
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 <christophe.jaillet@wanadoo.fr>
> ---
> 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 <hare@suse.de>

Cheers,

Hannes
  
Christoph Hellwig May 12, 2023, 3:02 p.m. UTC | #3
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
  
Keith Busch May 25, 2023, 6:02 p.m. UTC | #4
Thanks, applied for nvme-6.5.
  

Patch

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: