Skip to contentSkip to conversation

nvme: remove redundant initialization of variable ret

PATCH Applied Colin King 3 participants 3 messages May 13, 2021 – May 19, 2021

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 nvme: remove redundant initialization of variable ret

From: Colin Ian King <[email protected]>

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

---
 drivers/nvme/host/rdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/rdma.c +1 -1
index 37943dc4c2c1..74bf2c7f2b80 100644
@@ -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);
Signature · 1 line
2.30.2
#1 lore raw

drivers/nvme/host/rdma.c static void nvme_rdma_reconnect_or_remove(struct nvme_rdma_ctrl *ctrl) · line 1092

Quoted 6 lines · Colin King
drivers/nvme/host/rdma.c +1 -1
-    int ret = -EINVAL;
+    int ret;
   bool changed;

It'd be nice to move ret declaration after book changed.