Linux-NVME Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] nvme: tcp: remove redundant assignment to variable ret
@ 2019-09-05 14:34 Colin King
  2019-09-05 14:59 ` Max Gurtovoy
  2019-09-05 16:12 ` Sagi Grimberg
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2019-09-05 14:34 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg, linux-nvme
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable ret is being initialized with a value that is never read
and is being re-assigned immediately afterwards. The assignment is
redundant and hence can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/nvme/host/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 2d8ba31cb691..d91be6ddfe25 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1824,7 +1824,7 @@ static void nvme_tcp_reconnect_or_remove(struct nvme_ctrl *ctrl)
 static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new)
 {
 	struct nvmf_ctrl_options *opts = ctrl->opts;
-	int ret = -EINVAL;
+	int ret;
 
 	ret = nvme_tcp_configure_admin_queue(ctrl, new);
 	if (ret)
-- 
2.20.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH] nvme: tcp: remove redundant assignment to variable ret
  2019-09-05 14:34 [PATCH] nvme: tcp: remove redundant assignment to variable ret Colin King
@ 2019-09-05 14:59 ` Max Gurtovoy
  2019-09-05 16:12 ` Sagi Grimberg
  1 sibling, 0 replies; 3+ messages in thread
From: Max Gurtovoy @ 2019-09-05 14:59 UTC (permalink / raw)
  To: Colin King, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, linux-nvme
  Cc: kernel-janitors, linux-kernel


On 9/5/2019 5:34 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable ret is being initialized with a value that is never read
> and is being re-assigned immediately afterwards. The assignment is
> redundant and hence can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/nvme/host/tcp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
> index 2d8ba31cb691..d91be6ddfe25 100644
> --- a/drivers/nvme/host/tcp.c
> +++ b/drivers/nvme/host/tcp.c
> @@ -1824,7 +1824,7 @@ static void nvme_tcp_reconnect_or_remove(struct nvme_ctrl *ctrl)
>   static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new)
>   {
>   	struct nvmf_ctrl_options *opts = ctrl->opts;
> -	int ret = -EINVAL;
> +	int ret;
>   
>   	ret = nvme_tcp_configure_admin_queue(ctrl, new);
>   	if (ret)

Looks fine,

Reviewed-by: Max Gurtovoy <maxg@mellanox.com>


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH] nvme: tcp: remove redundant assignment to variable ret
  2019-09-05 14:34 [PATCH] nvme: tcp: remove redundant assignment to variable ret Colin King
  2019-09-05 14:59 ` Max Gurtovoy
@ 2019-09-05 16:12 ` Sagi Grimberg
  1 sibling, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2019-09-05 16:12 UTC (permalink / raw)
  To: Colin King, Keith Busch, Jens Axboe, Christoph Hellwig, linux-nvme
  Cc: kernel-janitors, linux-kernel

Applied to nvme-5.4

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05 14:34 [PATCH] nvme: tcp: remove redundant assignment to variable ret Colin King
2019-09-05 14:59 ` Max Gurtovoy
2019-09-05 16:12 ` Sagi Grimberg

Linux-NVME Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvme/0 linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ https://lore.kernel.org/linux-nvme \
		linux-nvme@lists.infradead.org linux-nvme@archiver.kernel.org
	public-inbox-index linux-nvme


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-nvme


AGPL code for this site: git clone https://public-inbox.org/ public-inbox