[PATCH] nvmet/rdma: fix ptr_ret.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



drivers/nvme/target/rdma.c:1441:1-3: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---

 rdma.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1438,10 +1438,7 @@ static int nvmet_rdma_add_port(struct nv
 	mutex_unlock(&nvmet_rdma_ports_mutex);
 
 	rdma_port = nvmet_rdma_listen_cmid(pb);
-	if (IS_ERR(rdma_port))
-		return PTR_ERR(rdma_port);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(rdma_port);
 }
 
 static void nvmet_rdma_remove_port(struct nvmet_port_binding *pb)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux