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] nvme-pci: use standard block status symbolic names to check return value
Date: Wed, 8 Jul 2020 10:18:01 +0800 [thread overview]
Message-ID: <e993c13466075f6dbae1285e4db55fd16276ff14.1594174565.git.baolin.wang@linux.alibaba.com> (raw)
It's better to use the same symbol as the return to check return value,
and will always work in the unlikely event that the defines are reordered.
Suggested-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
drivers/nvme/host/pci.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 1ac0717..45cb59c 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -873,18 +873,18 @@ static blk_status_t nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
return BLK_STS_IOERR;
ret = nvme_setup_cmd(ns, req, &cmnd);
- if (ret)
+ if (ret != BLK_STS_OK)
return ret;
if (blk_rq_nr_phys_segments(req)) {
ret = nvme_map_data(dev, req, &cmnd);
- if (ret)
+ if (ret != BLK_STS_OK)
goto out_free_cmd;
}
if (blk_integrity_rq(req)) {
ret = nvme_map_metadata(dev, req, &cmnd);
- if (ret)
+ if (ret != BLK_STS_OK)
goto out_unmap_data;
}
--
1.8.3.1
next reply other threads:[~2020-07-08 2:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-08 2:18 Baolin Wang [this message]
2020-07-08 5:09 ` Christoph Hellwig
2020-07-08 6:17 ` Baolin Wang
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=e993c13466075f6dbae1285e4db55fd16276ff14.1594174565.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®