linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme-fabrics: remove unneeded variable
@ 2022-01-07  2:23 cgel.zte
  2022-01-09 12:53 ` Sagi Grimberg
  2022-01-26 16:14 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: cgel.zte @ 2022-01-07  2:23 UTC (permalink / raw)
  To: kbusch
  Cc: axboe, hch, sagi, linux-nvme, linux-kernel, Changcheng Deng, Zeal Robot

From: Changcheng Deng <deng.changcheng@zte.com.cn>

Remove unneeded variable used to store return value.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
---
 drivers/nvme/host/fabrics.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 7ae041e2b3fb..f79a66d4e22c 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -1092,7 +1092,6 @@ static void __nvmf_concat_opt_tokens(struct seq_file *seq_file)
 static int nvmf_dev_show(struct seq_file *seq_file, void *private)
 {
 	struct nvme_ctrl *ctrl;
-	int ret = 0;
 
 	mutex_lock(&nvmf_dev_mutex);
 	ctrl = seq_file->private;
@@ -1106,7 +1105,7 @@ static int nvmf_dev_show(struct seq_file *seq_file, void *private)
 
 out_unlock:
 	mutex_unlock(&nvmf_dev_mutex);
-	return ret;
+	return 0;
 }
 
 static int nvmf_dev_open(struct inode *inode, struct file *file)
-- 
2.25.1


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

* Re: [PATCH] nvme-fabrics: remove unneeded variable
  2022-01-07  2:23 [PATCH] nvme-fabrics: remove unneeded variable cgel.zte
@ 2022-01-09 12:53 ` Sagi Grimberg
  2022-01-26 16:14 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2022-01-09 12:53 UTC (permalink / raw)
  To: cgel.zte, kbusch
  Cc: axboe, hch, linux-nvme, linux-kernel, Changcheng Deng, Zeal Robot


> From: Changcheng Deng <deng.changcheng@zte.com.cn>
> 
> Remove unneeded variable used to store return value.

I actually think that ret is missing an assignment in the error
case (e.g ret = -ENODEV)...

> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
> ---
>   drivers/nvme/host/fabrics.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
> index 7ae041e2b3fb..f79a66d4e22c 100644
> --- a/drivers/nvme/host/fabrics.c
> +++ b/drivers/nvme/host/fabrics.c
> @@ -1092,7 +1092,6 @@ static void __nvmf_concat_opt_tokens(struct seq_file *seq_file)
>   static int nvmf_dev_show(struct seq_file *seq_file, void *private)
>   {
>   	struct nvme_ctrl *ctrl;
> -	int ret = 0;
>   
>   	mutex_lock(&nvmf_dev_mutex);
>   	ctrl = seq_file->private;
> @@ -1106,7 +1105,7 @@ static int nvmf_dev_show(struct seq_file *seq_file, void *private)
>   
>   out_unlock:
>   	mutex_unlock(&nvmf_dev_mutex);
> -	return ret;
> +	return 0;
>   }
>   
>   static int nvmf_dev_open(struct inode *inode, struct file *file)
> 

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

* Re: [PATCH] nvme-fabrics: remove unneeded variable
  2022-01-07  2:23 [PATCH] nvme-fabrics: remove unneeded variable cgel.zte
  2022-01-09 12:53 ` Sagi Grimberg
@ 2022-01-26 16:14 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2022-01-26 16:14 UTC (permalink / raw)
  To: cgel.zte
  Cc: kbusch, axboe, hch, sagi, linux-nvme, linux-kernel,
	Changcheng Deng, Zeal Robot

Thanks,

applied to nvme-5.17.

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

end of thread, other threads:[~2022-01-26 16:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07  2:23 [PATCH] nvme-fabrics: remove unneeded variable cgel.zte
2022-01-09 12:53 ` Sagi Grimberg
2022-01-26 16:14 ` Christoph Hellwig

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).