From 445b0c8eba3bf0e07e9164b59b6de48eaa19d72f Mon Sep 17 00:00:00 2001 From: Lijun Ou Date: Mon, 2 Nov 2020 22:38:19 +0800 Subject: [PATCH] net/hns3: cleanup includes Some header files have included by others. Also, some header files have a header file self-contained error will trigger building warning. As a result, it is unnecessary and move it into the correct location. Beside, here also remove some unused lines. Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_cmd.c | 15 --------------- drivers/net/hns3/hns3_cmd.h | 2 ++ drivers/net/hns3/hns3_dcb.c | 7 ------- drivers/net/hns3/hns3_dcb.h | 4 ++++ drivers/net/hns3/hns3_ethdev.c | 23 ++++------------------- drivers/net/hns3/hns3_ethdev.h | 5 ----- drivers/net/hns3/hns3_ethdev_vf.c | 21 +-------------------- drivers/net/hns3/hns3_fdir.c | 1 - drivers/net/hns3/hns3_flow.c | 2 -- drivers/net/hns3/hns3_intr.c | 4 ---- drivers/net/hns3/hns3_intr.h | 4 ++++ drivers/net/hns3/hns3_mbx.c | 14 -------------- drivers/net/hns3/hns3_mp.c | 2 -- drivers/net/hns3/hns3_regs.c | 16 ---------------- drivers/net/hns3/hns3_rss.c | 3 --- drivers/net/hns3/hns3_rxtx.c | 13 ------------- drivers/net/hns3/hns3_rxtx.h | 3 +++ drivers/net/hns3/hns3_stats.c | 4 ---- 18 files changed, 18 insertions(+), 125 deletions(-) diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c index 589547c7e6..4f52ed034d 100644 --- a/drivers/net/hns3/hns3_cmd.c +++ b/drivers/net/hns3/hns3_cmd.c @@ -2,21 +2,6 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h index 13550b9c7d..194c3a731b 100644 --- a/drivers/net/hns3/hns3_cmd.h +++ b/drivers/net/hns3/hns3_cmd.h @@ -5,6 +5,8 @@ #ifndef _HNS3_CMD_H_ #define _HNS3_CMD_H_ +#include + #define HNS3_CMDQ_TX_TIMEOUT 30000 #define HNS3_CMDQ_RX_INVLD_B 0 #define HNS3_CMDQ_RX_OUTVLD_B 1 diff --git a/drivers/net/hns3/hns3_dcb.c b/drivers/net/hns3/hns3_dcb.c index ae8d8268d2..351eb87e95 100644 --- a/drivers/net/hns3/hns3_dcb.c +++ b/drivers/net/hns3/hns3_dcb.c @@ -2,17 +2,10 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include -#include -#include -#include -#include #include -#include #include #include "hns3_logs.h" -#include "hns3_regs.h" #include "hns3_ethdev.h" #include "hns3_dcb.h" diff --git a/drivers/net/hns3/hns3_dcb.h b/drivers/net/hns3/hns3_dcb.h index 7ab90933f3..fee23d9b4c 100644 --- a/drivers/net/hns3/hns3_dcb.h +++ b/drivers/net/hns3/hns3_dcb.h @@ -5,6 +5,10 @@ #ifndef _HNS3_DCB_H_ #define _HNS3_DCB_H_ +#include + +#include "hns3_cmd.h" + #define HNS3_ETHER_MAX_RATE 100000 /* MAC Pause */ diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 180b313c01..84d83469c3 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -2,25 +2,10 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include #include -#include #include #include "hns3_ethdev.h" @@ -3450,8 +3435,8 @@ hns3_is_rx_buf_ok(struct hns3_hw *hw, struct hns3_pkt_buf_alloc *buf_alloc, hi_thrd = shared_buf - pf->dv_buf_size; if (tc_num <= NEED_RESERVE_TC_NUM) - hi_thrd = hi_thrd * BUF_RESERVE_PERCENT - / BUF_MAX_PERCENT; + hi_thrd = hi_thrd * BUF_RESERVE_PERCENT / + BUF_MAX_PERCENT; if (tc_num) hi_thrd = hi_thrd / tc_num; @@ -6256,7 +6241,7 @@ static const struct rte_pci_id pci_id_hns3_map[] = { { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_50GE_RDMA) }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_100G_RDMA_MACSEC) }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_200G_RDMA) }, - { .vendor_id = 0, /* sentinel */ }, + { .vendor_id = 0, }, /* sentinel */ }; static struct rte_pci_driver rte_hns3_pmd = { diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h index 531a6cb7ab..63e0c2fb36 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -6,7 +6,6 @@ #define _HNS3_ETHDEV_H_ #include -#include #include #include "hns3_cmd.h" @@ -792,12 +791,8 @@ struct hns3_adapter { #define HNS3_DEV_PRIVATE_TO_HW(adapter) \ (&((struct hns3_adapter *)adapter)->hw) -#define HNS3_DEV_PRIVATE_TO_ADAPTER(adapter) \ - ((struct hns3_adapter *)adapter) #define HNS3_DEV_PRIVATE_TO_PF(adapter) \ (&((struct hns3_adapter *)adapter)->pf) -#define HNS3VF_DEV_PRIVATE_TO_VF(adapter) \ - (&((struct hns3_adapter *)adapter)->vf) #define HNS3_DEV_HW_TO_ADAPTER(hw) \ container_of(hw, struct hns3_adapter, hw) diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 088a46fed8..fb55d5822b 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -2,29 +2,10 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include -#include -#include -#include -#include -#include -#include #include - #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include -#include #include #include @@ -2887,7 +2868,7 @@ eth_hns3vf_pci_remove(struct rte_pci_device *pci_dev) static const struct rte_pci_id pci_id_hns3vf_map[] = { { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_100G_VF) }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_100G_RDMA_PFC_VF) }, - { .vendor_id = 0, /* sentinel */ }, + { .vendor_id = 0, }, /* sentinel */ }; static struct rte_pci_driver rte_hns3vf_pmd = { diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c index 79e3028b6d..62ccabceec 100644 --- a/drivers/net/hns3/hns3_fdir.c +++ b/drivers/net/hns3/hns3_fdir.c @@ -2,7 +2,6 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include #include #include #include diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 0d5dd1a7af..ff00dc1bc4 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -2,8 +2,6 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include -#include #include #include #include diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c index 2565688c58..bfd2ba864b 100644 --- a/drivers/net/hns3/hns3_intr.c +++ b/drivers/net/hns3/hns3_intr.c @@ -2,15 +2,11 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include -#include #include #include #include #include #include -#include -#include #include "hns3_ethdev.h" #include "hns3_logs.h" diff --git a/drivers/net/hns3/hns3_intr.h b/drivers/net/hns3/hns3_intr.h index 2b802bc7c4..19de1aa2d8 100644 --- a/drivers/net/hns3/hns3_intr.h +++ b/drivers/net/hns3/hns3_intr.h @@ -5,6 +5,10 @@ #ifndef _HNS3_INTR_H_ #define _HNS3_INTR_H_ +#include + +#include "hns3_ethdev.h" + #define HNS3_PPP_MPF_ECC_ERR_INT0_EN 0xFFFFFFFF #define HNS3_PPP_MPF_ECC_ERR_INT0_EN_MASK 0xFFFFFFFF #define HNS3_PPP_MPF_ECC_ERR_INT1_EN 0xFFFFFFFF diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c index 305007a823..adb23cb38d 100644 --- a/drivers/net/hns3/hns3_mbx.c +++ b/drivers/net/hns3/hns3_mbx.c @@ -2,22 +2,8 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include #include "hns3_ethdev.h" #include "hns3_regs.h" diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c index 639f46ced8..a5e98ff72f 100644 --- a/drivers/net/hns3/hns3_mp.c +++ b/drivers/net/hns3/hns3_mp.c @@ -2,8 +2,6 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include - #include #include #include diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c index 1b7dd7266d..b2cc599f12 100644 --- a/drivers/net/hns3/hns3_regs.c +++ b/drivers/net/hns3/hns3_regs.c @@ -2,24 +2,8 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include #include "hns3_ethdev.h" #include "hns3_logs.h" diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c index a4e552b221..e2f04687b2 100644 --- a/drivers/net/hns3/hns3_rss.c +++ b/drivers/net/hns3/hns3_rss.c @@ -2,12 +2,9 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include #include #include #include -#include -#include #include "hns3_ethdev.h" #include "hns3_logs.h" diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index afb1e7d670..bd3ccf618b 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -2,27 +2,14 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include -#include -#include -#include -#include -#include #include -#include #include #include -#include -#include -#include #include #include #include -#include -#include #include #include -#include #if defined(RTE_ARCH_ARM64) && defined(CC_SVE_SUPPORT) #include #endif diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h index 51504cabe8..8b32abe52a 100644 --- a/drivers/net/hns3/hns3_rxtx.h +++ b/drivers/net/hns3/hns3_rxtx.h @@ -5,6 +5,9 @@ #ifndef _HNS3_RXTX_H_ #define _HNS3_RXTX_H_ +#include +#include + #define HNS3_MIN_RING_DESC 64 #define HNS3_MAX_RING_DESC 32768 #define HNS3_DEFAULT_RING_DESC 1024 diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index 8c3c7cc01f..9bf6962eda 100644 --- a/drivers/net/hns3/hns3_stats.c +++ b/drivers/net/hns3/hns3_stats.c @@ -2,13 +2,9 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include -#include -#include #include #include #include -#include #include "hns3_ethdev.h" #include "hns3_rxtx.h" -- 2.20.1