From: Max Gurtovoy Date: Thu, 23 Sep 2021 10:17:44 +0000 (+0300) Subject: nvmet: use macro definitions for setting cmic value X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d56ae18f063e38eba47550c632519c9fe3f76b19;p=linux.git nvmet: use macro definitions for setting cmic value This makes the code more readable. Signed-off-by: Max Gurtovoy Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index dce53030b375a..6e75890bc8d90 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c @@ -385,7 +385,8 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req) */ /* we support multiple ports, multiples hosts and ANA: */ - id->cmic = (1 << 0) | (1 << 1) | (1 << 3); + id->cmic = NVME_CTRL_CMIC_MULTI_PORT | NVME_CTRL_CMIC_MULTI_CTRL | + NVME_CTRL_CMIC_ANA; /* Limit MDTS according to transport capability */ if (ctrl->ops->get_mdts) diff --git a/include/linux/nvme.h b/include/linux/nvme.h index ed2428918bca4..357482dedb599 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -320,6 +320,7 @@ struct nvme_id_ctrl { }; enum { + NVME_CTRL_CMIC_MULTI_PORT = 1 << 0, NVME_CTRL_CMIC_MULTI_CTRL = 1 << 1, NVME_CTRL_CMIC_ANA = 1 << 3, NVME_CTRL_ONCS_COMPARE = 1 << 0,