net: hns3: move duplicated macro definition into header
authorGuojia Liao <liaoguojia@huawei.com>
Tue, 21 Jan 2020 08:42:08 +0000 (16:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jan 2020 10:46:20 +0000 (11:46 +0100)
Macro HCLGE_GET_DFX_REG_TYPE_CNT in hclge_dbg_get_dfx_bd_num()
and macro HCLGE_DFX_REG_BD_NUM in hclge_get_dfx_reg_bd_num()
have the same meaning, so just defines HCLGE_GET_DFX_REG_TYPE_CNT
in hclge_main.h.

Signed-off-by: Guojia Liao <liaoguojia@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h

index f3d4cbd28913ef7cd94bb54c5119b9601cc5be06..67fad80035d3a76f6f5f74c95400ad05db81814e 100644 (file)
@@ -73,8 +73,6 @@ static struct hclge_dbg_reg_type_info hclge_dbg_reg_info[] = {
 
 static int hclge_dbg_get_dfx_bd_num(struct hclge_dev *hdev, int offset)
 {
-#define HCLGE_GET_DFX_REG_TYPE_CNT     4
-
        struct hclge_desc desc[HCLGE_GET_DFX_REG_TYPE_CNT];
        int entries_per_desc;
        int index;
index 76e8aa40e1bc43a7acb088e90279245de41509a2..8e007b740fdd90e8cc3b9d5e9cfe153022b211e1 100644 (file)
@@ -10204,10 +10204,8 @@ static int hclge_get_dfx_reg_bd_num(struct hclge_dev *hdev,
                                    int *bd_num_list,
                                    u32 type_num)
 {
-#define HCLGE_DFX_REG_BD_NUM   4
-
        u32 entries_per_desc, desc_index, index, offset, i;
-       struct hclge_desc desc[HCLGE_DFX_REG_BD_NUM];
+       struct hclge_desc desc[HCLGE_GET_DFX_REG_TYPE_CNT];
        int ret;
 
        ret = hclge_query_bd_num_cmd_send(hdev, desc);
index 1c1d6b35889752bfd7c2f09d07030ce8cbda1e1d..f78cbb4cc85eaee14320c6db8d5b4808c3237e3c 100644 (file)
 #define HCLGE_PHY_MDIX_STATUS_B                6
 #define HCLGE_PHY_SPEED_DUP_RESOLVE_B  11
 
+#define HCLGE_GET_DFX_REG_TYPE_CNT     4
+
 /* Factor used to calculate offset and bitmap of VF num */
 #define HCLGE_VF_NUM_PER_CMD           64