Skip to contentSkip to conversation

nvme-pci: remove duplicate check

PATCH New Chaitanya Kulkarni 3 participants 3 messages Oct 17, 2018 – Oct 18, 2018 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-pci: remove duplicate check

This is a cleanup patch doesn't change any functionality. It removes the duplicate call to the blk_integrity_rq() in the nvme_map_data().

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 drivers/nvme/host/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/pci.c +2 -2
index 72737009b82d..4e023cd007e1 100644
@@ -772,10 +772,10 @@ static blk_status_t nvme_map_data(struct nvme_dev *dev, struct request *req,
 
 		if (!dma_map_sg(dev->dev, &iod->meta_sg, 1, dma_dir))
 			goto out_unmap;
-	}
 
-	if (blk_integrity_rq(req))
 		cmnd->rw.metadata = cpu_to_le64(sg_dma_address(&iod->meta_sg));
+	}
+
 	return BLK_STS_OK;
 
 out_unmap:
Signature · 1 line
2.17.0
#1 lore raw

PATCH 1/1 nvme-pci: remove duplicate check

Quoted 4 lines · Chaitanya Kulkarni

This is a cleanup patch doesn't change any functionality. It removes the duplicate call to the blk_integrity_rq() in the nvme_map_data().

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>

Looks good.

Reviewed-by Keith Busch <keith.busch at intel.com>
Quoted 22 lines
---
 drivers/nvme/host/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/pci.c +2 -2
index 72737009b82d..4e023cd007e1 100644
@@ -772,10 +772,10 @@ static blk_status_t nvme_map_data(struct nvme_dev *dev, struct request *req,
 
 		if (!dma_map_sg(dev->dev, &iod->meta_sg, 1, dma_dir))
 			goto out_unmap;
-	}
 
-	if (blk_integrity_rq(req))
 		cmnd->rw.metadata = cpu_to_le64(sg_dma_address(&iod->meta_sg));
+	}
+
 	return BLK_STS_OK;
 
 out_unmap: