Skip to content

Commit f9ddefb

Browse files
hreineckekeithbusch
authored andcommitted
nvme-auth: open-code single-use macros
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> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 6d3c7fb commit f9ddefb

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

drivers/nvme/host/auth.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ struct nvme_dhchap_queue_context {
4848

4949
static struct workqueue_struct *nvme_auth_wq;
5050

51-
#define nvme_auth_flags_from_qid(qid) \
52-
(qid == 0) ? 0 : BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_RESERVED
53-
#define nvme_auth_queue_from_qid(ctrl, qid) \
54-
(qid == 0) ? (ctrl)->fabrics_q : (ctrl)->connect_q
55-
5651
static inline int ctrl_max_dhchaps(struct nvme_ctrl *ctrl)
5752
{
5853
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,
6358
void *data, size_t data_len, bool auth_send)
6459
{
6560
struct nvme_command cmd = {};
66-
blk_mq_req_flags_t flags = nvme_auth_flags_from_qid(qid);
67-
struct request_queue *q = nvme_auth_queue_from_qid(ctrl, qid);
61+
blk_mq_req_flags_t flags = 0;
62+
struct request_queue *q = ctrl->fabrics_q;
6863
int ret;
6964

65+
if (qid != 0) {
66+
flags |= BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_RESERVED;
67+
q = ctrl->connect_q;
68+
}
69+
7070
cmd.auth_common.opcode = nvme_fabrics_command;
7171
cmd.auth_common.secp = NVME_AUTH_DHCHAP_PROTOCOL_IDENTIFIER;
7272
cmd.auth_common.spsp0 = 0x01;

0 commit comments

Comments
 (0)