diff options
author | Baolin Wang <baolin.wang@linux.alibaba.com> | 2020-07-03 10:49:22 +0800 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-07-08 16:16:21 +0200 |
commit | c25c853ef60d2c0d37420b9e4b81bdd49e90b46e (patch) | |
tree | 5273bb10affb12a4fa5b84b46951465ef8258200 /drivers/nvme | |
parent | 972b13e29d40753a4ab2cd9735bd6ce26e91d6a6 (diff) | |
download | linux-c25c853ef60d2c0d37420b9e4b81bdd49e90b46e.tar.bz2 |
nvme-pci: remove redundant segment validation
We've validated the segment counts before calling nvme_map_data(),
so there is no need to validate again in nvme_pci_use_sgls(, which is
only called from nvme_map_data().
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/pci.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 83585ed5ec1f..9216cbd2fd43 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -501,9 +501,6 @@ static inline bool nvme_pci_use_sgls(struct nvme_dev *dev, struct request *req) int nseg = blk_rq_nr_phys_segments(req); unsigned int avg_seg_size; - if (nseg == 0) - return false; - avg_seg_size = DIV_ROUND_UP(blk_rq_payload_bytes(req), nseg); if (!(dev->ctrl.sgls & ((1 << 0) | (1 << 1)))) |