OSDN Git Service

nvmet: use macro definitions for setting cmic value
authorMax Gurtovoy <mgurtovoy@nvidia.com>
Thu, 23 Sep 2021 10:17:44 +0000 (13:17 +0300)
committerChristoph Hellwig <hch@lst.de>
Wed, 20 Oct 2021 17:16:03 +0000 (19:16 +0200)
This makes the code more readable.

Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/admin-cmd.c
include/linux/nvme.h

index dce5303..6e75890 100644 (file)
@@ -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)
index ed24289..357482d 100644 (file)
@@ -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,