Skip to content

Commit

Permalink
nvme: improve the NVME_CONNECT_AUTHREQ* definitions
Browse files Browse the repository at this point in the history
Mark them as unsigned so that we don't need extra casts, and define
them relative to cdword0 instead of requiring extra shifts.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Hannes Reinecke <hare@suse.de>
  • Loading branch information
Christoph Hellwig committed Sep 27, 2022
1 parent 1befd94 commit 1c32a80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions drivers/nvme/target/fabrics-cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req)
req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid);

if (nvmet_has_auth(ctrl))
req->cqe->result.u32 |=
cpu_to_le32((u32)NVME_CONNECT_AUTHREQ_ATR << 16);
req->cqe->result.u32 |= cpu_to_le32(NVME_CONNECT_AUTHREQ_ATR);
out:
kfree(d);
complete:
Expand Down Expand Up @@ -334,8 +333,7 @@ static void nvmet_execute_io_connect(struct nvmet_req *req)

pr_debug("adding queue %d to ctrl %d.\n", qid, ctrl->cntlid);
if (nvmet_has_auth(ctrl))
req->cqe->result.u32 |=
cpu_to_le32((u32)NVME_CONNECT_AUTHREQ_ATR << 16);
req->cqe->result.u32 |= cpu_to_le32(NVME_CONNECT_AUTHREQ_ATR);

out:
kfree(d);
Expand Down
4 changes: 2 additions & 2 deletions include/linux/nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -1482,8 +1482,8 @@ struct nvmf_connect_command {
};

enum {
NVME_CONNECT_AUTHREQ_ASCR = (1 << 2),
NVME_CONNECT_AUTHREQ_ATR = (1 << 1),
NVME_CONNECT_AUTHREQ_ASCR = (1U << 18),
NVME_CONNECT_AUTHREQ_ATR = (1U << 17),
};

struct nvmf_connect_data {
Expand Down

0 comments on commit 1c32a80

Please sign in to comment.