From: hare@kernel.org
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Sagi Grimberg <sagi@grimberg.me>,
linux-nvme@lists.infradead.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 1/3] nvme-auth: open-code single-use macros
Date: Mon, 29 Jan 2024 07:39:45 +0100 [thread overview]
Message-ID: <20240129063948.3105-2-hare@kernel.org> (raw)
In-Reply-To: <20240129063948.3105-1-hare@kernel.org>
From: Hannes Reinecke <hare@suse.de>
No point in having macros just for a single function nvme_auth_submit().
Open-code them into the caller.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/host/auth.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c
index 72c0525c75f5..9aa2325f9a98 100644
--- a/drivers/nvme/host/auth.c
+++ b/drivers/nvme/host/auth.c
@@ -48,11 +48,6 @@ struct nvme_dhchap_queue_context {
static struct workqueue_struct *nvme_auth_wq;
-#define nvme_auth_flags_from_qid(qid) \
- (qid == 0) ? 0 : BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_RESERVED
-#define nvme_auth_queue_from_qid(ctrl, qid) \
- (qid == 0) ? (ctrl)->fabrics_q : (ctrl)->connect_q
-
static inline int ctrl_max_dhchaps(struct nvme_ctrl *ctrl)
{
return ctrl->opts->nr_io_queues + ctrl->opts->nr_write_queues +
@@ -63,10 +58,15 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid,
void *data, size_t data_len, bool auth_send)
{
struct nvme_command cmd = {};
- blk_mq_req_flags_t flags = nvme_auth_flags_from_qid(qid);
- struct request_queue *q = nvme_auth_queue_from_qid(ctrl, qid);
+ blk_mq_req_flags_t flags = 0;
+ struct request_queue *q = ctrl->fabrics_q;
int ret;
+ if (qid != 0) {
+ flags |= BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_RESERVED;
+ q = ctrl->connect_q;
+ }
+
cmd.auth_common.opcode = nvme_fabrics_command;
cmd.auth_common.secp = NVME_AUTH_DHCHAP_PROTOCOL_IDENTIFIER;
cmd.auth_common.spsp0 = 0x01;
--
2.35.3
next prev parent reply other threads:[~2024-01-29 6:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-29 6:39 [PATCHv4 0/3] nvme: enable retries for authentication commands hare
2024-01-29 6:39 ` hare [this message]
2024-01-29 20:00 ` [PATCH 1/3] nvme-auth: open-code single-use macros Sagi Grimberg
2024-01-29 6:39 ` [PATCH 2/3] nvme: change __nvme_submit_sync_cmd() calling conventions hare
2024-01-29 20:00 ` Sagi Grimberg
2024-01-29 6:39 ` [PATCH 2/3] nvme: simplify " hare
2024-01-29 20:01 ` Sagi Grimberg
2024-01-29 6:39 ` [PATCH 3/3] nvme: enable retries for authentication commands hare
2024-01-29 7:10 ` Christoph Hellwig
2024-01-29 20:01 ` Sagi Grimberg
2024-02-01 0:29 ` [PATCHv4 0/3] " Keith Busch
-- strict thread matches above, loose matches on Subject: below --
2024-01-27 9:37 [PATCHv3 " hare
2024-01-27 9:37 ` [PATCH 1/3] nvme-auth: open-code single-use macros hare
2024-01-29 5:58 ` Christoph Hellwig
2024-01-29 14:19 ` Sagi Grimberg
2024-01-29 15:13 ` Keith Busch
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=20240129063948.3105-2-hare@kernel.org \
--to=hare@kernel.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=kbusch@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.