* [PATCH] nvme: remove redundant initialization of variable ret
@ 2021-05-13 11:59 Colin King
2021-05-14 4:43 ` Chaitanya Kulkarni
2021-05-19 7:00 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2021-05-13 11:59 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,
it is being updated later on. The assignment is redundant and can be
removed.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/nvme/host/rdma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 37943dc4c2c1..74bf2c7f2b80 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1088,7 +1088,7 @@ static void nvme_rdma_reconnect_or_remove(struct nvme_rdma_ctrl *ctrl)
static int nvme_rdma_setup_ctrl(struct nvme_rdma_ctrl *ctrl, bool new)
{
- int ret = -EINVAL;
+ int ret;
bool changed;
ret = nvme_rdma_configure_admin_queue(ctrl, new);
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme: remove redundant initialization of variable ret
2021-05-13 11:59 [PATCH] nvme: remove redundant initialization of variable ret Colin King
@ 2021-05-14 4:43 ` Chaitanya Kulkarni
2021-05-19 7:00 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2021-05-14 4:43 UTC (permalink / raw)
To: Colin King
Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
linux-nvme, kernel-janitors, linux-kernel
> On May 13, 2021, at 5:08 AM, Colin King <colin.king@canonical.com> wrote:
>
> - int ret = -EINVAL;
> + int ret;
> bool changed;
It'd be nice to move ret declaration after book changed.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme: remove redundant initialization of variable ret
2021-05-13 11:59 [PATCH] nvme: remove redundant initialization of variable ret Colin King
2021-05-14 4:43 ` Chaitanya Kulkarni
@ 2021-05-19 7:00 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-05-19 7:00 UTC (permalink / raw)
To: Colin King
Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
linux-nvme, kernel-janitors, linux-kernel
Thanks,
applied to nvme-5.14.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-19 7:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 11:59 [PATCH] nvme: remove redundant initialization of variable ret Colin King
2021-05-14 4:43 ` Chaitanya Kulkarni
2021-05-19 7:00 ` 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).