From: Weiwen Hu <huweiwen@linux.alibaba.com>
To: linux-nvme@lists.infradead.org,
Chaitanya Kulkarni <chaitanyak@nvidia.com>,
Keith Busch <kbusch@kernel.org>
Cc: Mike Christie <michael.christie@oracle.com>,
Christoph Hellwig <hch@lst.de>,
Weiwen Hu <huweiwen@linux.alibaba.com>
Subject: [PATCH v2 1/4] nvme: rename nvme_sc_to_pr_err to nvme_status_to_pr_err
Date: Mon, 3 Jun 2024 20:56:59 +0800 [thread overview]
Message-ID: <20240603125702.97368-2-huweiwen@linux.alibaba.com> (raw)
In-Reply-To: <20240603125702.97368-1-huweiwen@linux.alibaba.com>
This should better match its semantic. "sc" is used in the NVMe spec to
specifically refer to the last 8 bits in the status field. We should not
reuse "sc" here.
Signed-off-by: Weiwen Hu <huweiwen@linux.alibaba.com>
---
drivers/nvme/host/pr.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/nvme/host/pr.c b/drivers/nvme/host/pr.c
index 8fa1ffcdaed4..a6db5edfab03 100644
--- a/drivers/nvme/host/pr.c
+++ b/drivers/nvme/host/pr.c
@@ -72,12 +72,12 @@ static int nvme_send_ns_pr_command(struct nvme_ns *ns, struct nvme_command *c,
return nvme_submit_sync_cmd(ns->queue, c, data, data_len);
}
-static int nvme_sc_to_pr_err(int nvme_sc)
+static int nvme_status_to_pr_err(int status)
{
- if (nvme_is_path_error(nvme_sc))
+ if (nvme_is_path_error(status))
return PR_STS_PATH_FAILED;
- switch (nvme_sc & 0x7ff) {
+ switch (status & 0x7ff) {
case NVME_SC_SUCCESS:
return PR_STS_SUCCESS;
case NVME_SC_RESERVATION_CONFLICT:
@@ -121,7 +121,7 @@ static int nvme_pr_command(struct block_device *bdev, u32 cdw10,
if (ret < 0)
return ret;
- return nvme_sc_to_pr_err(ret);
+ return nvme_status_to_pr_err(ret);
}
static int nvme_pr_register(struct block_device *bdev, u64 old,
@@ -196,7 +196,7 @@ static int nvme_pr_resv_report(struct block_device *bdev, void *data,
if (ret < 0)
return ret;
- return nvme_sc_to_pr_err(ret);
+ return nvme_status_to_pr_err(ret);
}
static int nvme_pr_read_keys(struct block_device *bdev,
--
2.45.1
next prev parent reply other threads:[~2024-06-03 12:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-03 12:56 [PATCH v2 0/4] clarify NVMe status symbol names Weiwen Hu
2024-06-03 12:56 ` Weiwen Hu [this message]
2024-06-04 23:57 ` [PATCH v2 1/4] nvme: rename nvme_sc_to_pr_err to nvme_status_to_pr_err Chaitanya Kulkarni
2024-06-05 8:54 ` Sagi Grimberg
2024-06-03 12:57 ` [PATCH v2 2/4] nvme: fix status magic numbers Weiwen Hu
2024-06-05 0:02 ` Chaitanya Kulkarni
2024-06-05 8:55 ` Sagi Grimberg
2024-06-03 12:57 ` [PATCH v2 3/4] nvme: rename CDR/MORE/DNR to NVME_STATUS_* Weiwen Hu
2024-06-05 0:03 ` Chaitanya Kulkarni
2024-06-05 8:55 ` Sagi Grimberg
2024-06-03 12:57 ` [PATCH v2 4/4] mailmap: add entry for Weiwen Hu Weiwen Hu
2024-06-04 4:25 ` [PATCH v2 0/4] clarify NVMe status symbol names 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=20240603125702.97368-2-huweiwen@linux.alibaba.com \
--to=huweiwen@linux.alibaba.com \
--cc=chaitanyak@nvidia.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=michael.christie@oracle.com \
/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