linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvmet-auth: remove some dead code
@ 2023-04-17 20:41 Christophe JAILLET
  2023-04-18  4:06 ` Chaitanya Kulkarni
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Christophe JAILLET @ 2023-04-17 20:41 UTC (permalink / raw)
  To: Hannes Reinecke, Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-nvme

'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(-)

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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet-auth: remove some dead code
  2023-04-17 20:41 [PATCH] nvmet-auth: remove some dead code Christophe JAILLET
@ 2023-04-18  4:06 ` Chaitanya Kulkarni
  2023-05-02  6:04 ` Hannes Reinecke
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2023-04-18  4:06 UTC (permalink / raw)
  To: Christophe JAILLET, Hannes Reinecke, Christoph Hellwig,
	Sagi Grimberg, Chaitanya Kulkarni
  Cc: linux-kernel, kernel-janitors, linux-nvme

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet-auth: remove some dead code
  2023-04-17 20:41 [PATCH] nvmet-auth: remove some dead code Christophe JAILLET
  2023-04-18  4:06 ` Chaitanya Kulkarni
@ 2023-05-02  6:04 ` Hannes Reinecke
  2023-05-12 15:02 ` Christoph Hellwig
  2023-05-25 18:02 ` Keith Busch
  3 siblings, 0 replies; 5+ messages in thread
From: Hannes Reinecke @ 2023-05-02  6:04 UTC (permalink / raw)
  To: Christophe JAILLET, Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni
  Cc: linux-kernel, kernel-janitors, linux-nvme

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
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet-auth: remove some dead code
  2023-04-17 20:41 [PATCH] nvmet-auth: remove some dead code Christophe JAILLET
  2023-04-18  4:06 ` Chaitanya Kulkarni
  2023-05-02  6:04 ` Hannes Reinecke
@ 2023-05-12 15:02 ` Christoph Hellwig
  2023-05-25 18:02 ` Keith Busch
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2023-05-12 15:02 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Hannes Reinecke, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, linux-kernel, kernel-janitors, linux-nvme

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet-auth: remove some dead code
  2023-04-17 20:41 [PATCH] nvmet-auth: remove some dead code Christophe JAILLET
                   ` (2 preceding siblings ...)
  2023-05-12 15:02 ` Christoph Hellwig
@ 2023-05-25 18:02 ` Keith Busch
  3 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2023-05-25 18:02 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Hannes Reinecke, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, linux-kernel, kernel-janitors, linux-nvme

Thanks, applied for nvme-6.5.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-25 18:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-17 20:41 [PATCH] nvmet-auth: remove some dead code Christophe JAILLET
2023-04-18  4:06 ` Chaitanya Kulkarni
2023-05-02  6:04 ` Hannes Reinecke
2023-05-12 15:02 ` Christoph Hellwig
2023-05-25 18:02 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).