summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorIsrael Rukshin <israelr@mellanox.com>2019-08-28 14:11:48 +0300
committerSagi Grimberg <sagi@grimberg.me>2019-08-29 12:55:03 -0700
commitf2fa006f81cc5e7b5b9ef2c06dfeb50f52a47250 (patch)
tree5b691623657de7434a566c149ba716c6898e794c /drivers/nvme
parente7832cb48a654cd12b2bc9181b2f0ad49d526ac6 (diff)
downloadlinux-f2fa006f81cc5e7b5b9ef2c06dfeb50f52a47250.tar.gz
linux-f2fa006f81cc5e7b5b9ef2c06dfeb50f52a47250.tar.bz2
linux-f2fa006f81cc5e7b5b9ef2c06dfeb50f52a47250.zip
nvme-pci: Tidy up nvme_unmap_data
Remove pointless local variable and use rq_dma_dir macro. Signed-off-by: Israel Rukshin <israelr@mellanox.com> Reviewed-by: Max Gurtovoy <maxg@mellanox.com> Reviewed-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/pci.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 77bcda68fe1a..5c3732fd02bc 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -537,14 +537,13 @@ static inline bool nvme_pci_use_sgls(struct nvme_dev *dev, struct request *req)
static void nvme_unmap_data(struct nvme_dev *dev, struct request *req)
{
struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
- enum dma_data_direction dma_dir = rq_data_dir(req) ?
- DMA_TO_DEVICE : DMA_FROM_DEVICE;
const int last_prp = dev->ctrl.page_size / sizeof(__le64) - 1;
dma_addr_t dma_addr = iod->first_dma, next_dma_addr;
int i;
if (iod->dma_len) {
- dma_unmap_page(dev->dev, dma_addr, iod->dma_len, dma_dir);
+ dma_unmap_page(dev->dev, dma_addr, iod->dma_len,
+ rq_dma_dir(req));
return;
}