Skip to content

Commit

Permalink
net: hns3: move duplicated macro definition into header
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guojia Liao authored and David S. Miller committed Jan 21, 2020
1 parent afb6afd commit 9027d04
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@
#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

Expand Down

0 comments on commit 9027d04

Please sign in to comment.