mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me
Cc: baolin.wang@linux.alibaba.com, baolin.wang7@gmail.com,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/5] nvme-pci: Remove redundant segment validation
Date: Fri,  3 Jul 2020 10:49:22 +0800	[thread overview]
Message-ID: <84ef8fd8eb4d7289fa92b5be12cc71eb1af46c5b.1593743937.git.baolin.wang@linux.alibaba.com> (raw)
In-Reply-To: <cover.1593743937.git.baolin.wang@linux.alibaba.com>
In-Reply-To: <cover.1593743937.git.baolin.wang@linux.alibaba.com>

We've validated the segment counts before calling nvme_map_data(),
so there is no need to validate again in nvme_pci_use_sgls() only
called from nvme_map_data().

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
 drivers/nvme/host/pci.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index d0e9bbf..63bfb8b 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))))
-- 
1.8.3.1


  parent reply	other threads:[~2020-07-03  2:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03  2:49 [PATCH 0/5] Some cleanups for NVMe-pci driver Baolin Wang
2020-07-03  2:49 ` [PATCH 1/5] nvme-pci: Fix some comments issues Baolin Wang
2020-07-05  6:57   ` Sagi Grimberg
2020-07-06  2:10   ` Chaitanya Kulkarni
2020-07-03  2:49 ` [PATCH 2/5] nvme-pci: Add a blank line after declarations Baolin Wang
2020-07-05  6:57   ` Sagi Grimberg
2020-07-06  2:09   ` Chaitanya Kulkarni
2020-07-03  2:49 ` Baolin Wang [this message]
2020-07-06  2:23   ` [PATCH 3/5] nvme-pci: Remove redundant segment validation Chaitanya Kulkarni
2020-07-03  2:49 ` [PATCH 4/5] nvme-pci: Use the consistent return type of nvme_pci_iod_alloc_size() Baolin Wang
2020-07-05  6:59   ` Sagi Grimberg
2020-07-06  2:24   ` Chaitanya Kulkarni
2020-07-03  2:49 ` [PATCH 5/5] nvme-pci: Use standard block status macro Baolin Wang
2020-07-05  7:00   ` Sagi Grimberg
2020-07-06  2:25   ` Chaitanya Kulkarni
2020-07-07 19:01   ` Keith Busch
2020-07-08  1:25     ` Baolin Wang
2020-07-08  6:05     ` Christoph Hellwig
2020-07-07  8:50 ` [PATCH 0/5] Some cleanups for NVMe-pci driver Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84ef8fd8eb4d7289fa92b5be12cc71eb1af46c5b.1593743937.git.baolin.wang@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=axboe@fb.com \
    --cc=baolin.wang7@gmail.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®