RDMA/hns: Use macro instead of magic number
authorLijun Ou <oulijun@huawei.com>
Mon, 30 Jul 2018 12:20:29 +0000 (20:20 +0800)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 31 Jul 2018 02:42:44 +0000 (20:42 -0600)
This patch mainly uses CMD_CSQ_DESC_NUM instead of magic number in order
to improve readability.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c
drivers/infiniband/hw/hns/hns_roce_hw_v2.h

index 39842ece3c0f7a62e3a01ec9b91e64c438d53adc..57d744dc48f379b30bf88edfe8732f3180197e7f 100644 (file)
@@ -705,8 +705,8 @@ static int hns_roce_v2_cmq_init(struct hns_roce_dev *hr_dev)
        int ret;
 
        /* Setup the queue entries for command queue */
-       priv->cmq.csq.desc_num = 1024;
-       priv->cmq.crq.desc_num = 1024;
+       priv->cmq.csq.desc_num = CMD_CSQ_DESC_NUM;
+       priv->cmq.crq.desc_num = CMD_CRQ_DESC_NUM;
 
        /* Setup the lock for command queue */
        spin_lock_init(&priv->cmq.csq.lock);
index 5c43ba11a0bdd4f719896a63f1daf0c2f9a9903d..14aa308befef913d6c62d6c21c345f7c45ccbc87 100644 (file)
        (step_idx == 1 && hop_num == 1) || \
        (step_idx == 2 && hop_num == 2))
 
+#define CMD_CSQ_DESC_NUM               1024
+#define CMD_CRQ_DESC_NUM               1024
+
 enum {
        NO_ARMED = 0x0,
        REG_NXT_CEQE = 0x2,