[PATCH 3/3] nvme: make 'at_head' parameter for __nvme_submit_sync_cmd() boolean
Hannes Reinecke
hare at suse.de
Wed Feb 8 00:49:39 PST 2023
Use a boolean for the 'at_head' parameter in __nvme_submit_sync_cmd()
to improve readability and consistency; it's being converted into a
boolean anyway.
Signed-off-by: Hannes Reinecke <hare at suse.de>
---
drivers/nvme/host/auth.c | 2 +-
drivers/nvme/host/core.c | 8 ++++----
drivers/nvme/host/fabrics.c | 10 +++++-----
drivers/nvme/host/nvme.h | 2 +-
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c
index 50cd45e92998..4f287806571a 100644
--- a/drivers/nvme/host/auth.c
+++ b/drivers/nvme/host/auth.c
@@ -82,7 +82,7 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid,
if (IS_ERR(req))
return PTR_ERR(req);
- ret = __nvme_submit_sync_cmd(q, req, NULL, data, data_len, 0);
+ ret = __nvme_submit_sync_cmd(q, req, NULL, data, data_len, false);
if (ret > 0)
dev_warn(ctrl->device,
"qid %d auth_send failed with status %d\n", qid, ret);
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e7c954eae9c7..b8020c3ff13e 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1042,7 +1042,7 @@ EXPORT_SYMBOL_GPL(__nvme_alloc_rq);
* if the result is positive, it's an NVM Express status code
*/
int __nvme_submit_sync_cmd(struct request_queue *q, struct request *req,
- union nvme_result *result, void *buffer, unsigned bufflen, int at_head)
+ union nvme_result *result, void *buffer, unsigned bufflen, bool at_head)
{
int ret;
@@ -1070,7 +1070,7 @@ int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
if (IS_ERR(req))
return PTR_ERR(req);
- return __nvme_submit_sync_cmd(q, req, NULL, buffer, bufflen, 0);
+ return __nvme_submit_sync_cmd(q, req, NULL, buffer, bufflen, false);
}
EXPORT_SYMBOL_GPL(nvme_submit_sync_cmd);
@@ -1501,7 +1501,7 @@ static int nvme_features(struct nvme_ctrl *dev, u8 op, unsigned int fid,
return PTR_ERR(req);
ret = __nvme_submit_sync_cmd(dev->admin_q, req, &res,
- buffer, buflen, 0);
+ buffer, buflen, false);
if (ret >= 0 && result)
*result = le32_to_cpu(res.u32);
return ret;
@@ -2237,7 +2237,7 @@ static int nvme_sec_submit(void *data, u16 spsp, u8 secp, void *buffer, size_t l
if (IS_ERR(req))
return PTR_ERR(req);
- return __nvme_submit_sync_cmd(ctrl->admin_q, req, NULL, buffer, len, 1);
+ return __nvme_submit_sync_cmd(ctrl->admin_q, req, NULL, buffer, len, true);
}
static void nvme_configure_opal(struct nvme_ctrl *ctrl, bool was_suspended)
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index d999364af43d..ce56ff85d23c 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -157,7 +157,7 @@ int nvmf_reg_read32(struct nvme_ctrl *ctrl, u32 off, u32 *val)
if (IS_ERR(req))
return PTR_ERR(req);
- ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, req, &res, NULL, 0, 0);
+ ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, req, &res, NULL, 0, false);
if (ret >= 0)
*val = le64_to_cpu(res.u64);
@@ -207,7 +207,7 @@ int nvmf_reg_read64(struct nvme_ctrl *ctrl, u32 off, u64 *val)
if (IS_ERR(req))
return PTR_ERR(req);
- ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, req, &res, NULL, 0, 0);
+ ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, req, &res, NULL, 0, false);
if (ret >= 0)
*val = le64_to_cpu(res.u64);
@@ -256,7 +256,7 @@ int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val)
if (IS_ERR(req))
return PTR_ERR(req);
- ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, req, NULL, NULL, 0, 0);
+ ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, req, NULL, NULL, 0, false);
if (unlikely(ret))
dev_err(ctrl->device,
"Property Set error: %d, offset %#x\n",
@@ -418,7 +418,7 @@ int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl)
return PTR_ERR(req);
ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, req, &res,
- data, sizeof(*data), 1);
+ data, sizeof(*data), true);
if (ret) {
nvmf_log_connect_error(ctrl, ret, le32_to_cpu(res.u32),
&cmd, data);
@@ -509,7 +509,7 @@ int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid)
return PTR_ERR(req);
ret = __nvme_submit_sync_cmd(ctrl->connect_q, req, &res,
- data, sizeof(*data), 1);
+ data, sizeof(*data), true);
if (ret) {
nvmf_log_connect_error(ctrl, ret, le32_to_cpu(res.u32),
&cmd, data);
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 624f1879ee20..f506d0db3c06 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -817,7 +817,7 @@ int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
struct request *__nvme_alloc_rq(struct request_queue *q,
struct nvme_command *cmd, int qid, blk_mq_req_flags_t flags, bool retry);
int __nvme_submit_sync_cmd(struct request_queue *q, struct request *req, union nvme_result *result,
- void *buffer, unsigned bufflen, int at_head);
+ void *buffer, unsigned bufflen, bool at_head);
int nvme_set_features(struct nvme_ctrl *dev, unsigned int fid,
unsigned int dword11, void *buffer, size_t buflen,
u32 *result);
--
2.35.3
More information about the Linux-nvme
mailing list