From: Niklas Cassel <Niklas.Cassel@wdc.com>
To: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
"james.smart@broadcom.com" <james.smart@broadcom.com>,
"kbusch@kernel.org" <kbusch@kernel.org>,
"hch@lst.de" <hch@lst.de>
Subject: Re: [PATCH 4/5] nvme-pci: use helper for ctrl sgl check
Date: Mon, 7 Jun 2021 08:02:12 +0000 [thread overview]
Message-ID: <YL3Sg2xgnKN+/a4y@x1-carbon> (raw)
In-Reply-To: <20210607003705.21784-5-chaitanya.kulkarni@wdc.com>
On Sun, Jun 06, 2021 at 05:37:04PM -0700, Chaitanya Kulkarni wrote:
> Use helper to check the controller's SGL support instead of open coding.
>
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
> drivers/nvme/host/pci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 3aa7245a505f..a7e7afc609b4 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -536,7 +536,7 @@ static inline bool nvme_pci_use_sgls(struct nvme_dev *dev, struct request *req)
>
> avg_seg_size = DIV_ROUND_UP(blk_rq_payload_bytes(req), nseg);
>
> - if (!(dev->ctrl.sgls & ((1 << 0) | (1 << 1))))
> + if (!nvme_ctrl_sgl_supported(&dev->ctrl))
> return false;
> if (!iod->nvmeq->qid)
> return false;
> --
> 2.22.1
Hello Chaitanya,
I believe that you can apply the same cleanup for pci.c:nvme_map_data()
Kind regards,
Niklas
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2021-06-07 8:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-07 0:37 [PATCH 0/5] nvme: small cleanups Chaitanya Kulkarni
2021-06-07 0:37 ` [PATCH 1/5] nvme: use helper to remove duplicate code Chaitanya Kulkarni
2021-06-07 0:37 ` [PATCH 2/5] nvme-fc: add a helper to check ctrl sgl support Chaitanya Kulkarni
2021-06-07 0:37 ` [PATCH 3/5] nvme-tcp: use helper for ctrl sgl check Chaitanya Kulkarni
2021-06-07 0:37 ` [PATCH 4/5] nvme-pci: " Chaitanya Kulkarni
2021-06-07 8:02 ` Niklas Cassel [this message]
2021-06-07 0:37 ` [PATCH 5/5] nvme-pci: remove trailing lines for helpers Chaitanya Kulkarni
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=YL3Sg2xgnKN+/a4y@x1-carbon \
--to=niklas.cassel@wdc.com \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=hch@lst.de \
--cc=james.smart@broadcom.com \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
/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