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 <ouli...@huawei.com> --- 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 589547c..4f52ed0 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 <errno.h> -#include <stdbool.h> -#include <stdint.h> -#include <stdio.h> -#include <string.h> -#include <sys/queue.h> -#include <inttypes.h> -#include <unistd.h> -#include <rte_bus_pci.h> -#include <rte_common.h> -#include <rte_cycles.h> -#include <rte_dev.h> -#include <rte_eal.h> -#include <rte_ether.h> -#include <rte_ethdev_driver.h> #include <rte_ethdev_pci.h> #include <rte_io.h> diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h index 13550b9..194c3a7 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 <stdint.h> + #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 e06561c..ab02c87 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 <errno.h> -#include <inttypes.h> -#include <stdbool.h> -#include <string.h> -#include <unistd.h> #include <rte_io.h> -#include <rte_common.h> #include <rte_ethdev.h> #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 7ab9093..fee23d9 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 <stdint.h> + +#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 dc02af0..ba96724 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 <errno.h> -#include <stdarg.h> -#include <stdbool.h> -#include <stdio.h> -#include <stdint.h> -#include <inttypes.h> -#include <unistd.h> -#include <rte_atomic.h> +#include <rte_alarm.h> #include <rte_bus_pci.h> -#include <rte_common.h> -#include <rte_cycles.h> -#include <rte_dev.h> -#include <rte_eal.h> -#include <rte_ether.h> -#include <rte_ethdev_driver.h> #include <rte_ethdev_pci.h> -#include <rte_interrupts.h> #include <rte_io.h> -#include <rte_log.h> #include <rte_pci.h> #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 531a6cb..63e0c2f 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -6,7 +6,6 @@ #define _HNS3_ETHDEV_H_ #include <sys/time.h> -#include <rte_alarm.h> #include <rte_ethdev_driver.h> #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 ca1507a..3111dfb 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 <errno.h> -#include <stdio.h> -#include <stdbool.h> -#include <string.h> -#include <inttypes.h> -#include <unistd.h> -#include <arpa/inet.h> #include <linux/pci_regs.h> - #include <rte_alarm.h> -#include <rte_atomic.h> -#include <rte_bus_pci.h> -#include <rte_byteorder.h> -#include <rte_common.h> -#include <rte_cycles.h> -#include <rte_dev.h> -#include <rte_eal.h> -#include <rte_ether.h> -#include <rte_ethdev_driver.h> #include <rte_ethdev_pci.h> -#include <rte_interrupts.h> #include <rte_io.h> -#include <rte_log.h> #include <rte_pci.h> #include <rte_vfio.h> @@ -2888,7 +2869,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 e0e9419..857cc94 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 <stdbool.h> #include <rte_ethdev_driver.h> #include <rte_hash.h> #include <rte_hash_crc.h> diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 72d3745..2fff157 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 <stdbool.h> -#include <sys/queue.h> #include <rte_flow_driver.h> #include <rte_io.h> #include <rte_malloc.h> diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c index 2565688..bfd2ba8 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 <stdbool.h> -#include <rte_atomic.h> #include <rte_alarm.h> #include <rte_cycles.h> #include <rte_ethdev.h> #include <rte_io.h> #include <rte_malloc.h> -#include <rte_pci.h> -#include <rte_bus_pci.h> #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 2b802bc..19de1aa 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 <stdint.h> + +#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 c522c6d..d2a5db8 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 <errno.h> -#include <stdbool.h> -#include <stdint.h> -#include <stdio.h> -#include <string.h> -#include <inttypes.h> -#include <unistd.h> -#include <rte_byteorder.h> -#include <rte_common.h> -#include <rte_cycles.h> -#include <rte_dev.h> #include <rte_ethdev_driver.h> #include <rte_io.h> -#include <rte_spinlock.h> -#include <rte_pci.h> -#include <rte_bus_pci.h> #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 7e0fc46..ed2567a 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 <stdbool.h> - #include <rte_eal.h> #include <rte_ethdev_driver.h> #include <rte_string_fns.h> diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c index 1b7dd72..b2cc599 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 <errno.h> -#include <stdarg.h> -#include <stdbool.h> -#include <string.h> -#include <stdint.h> -#include <stdio.h> -#include <inttypes.h> -#include <unistd.h> -#include <rte_bus_pci.h> -#include <rte_byteorder.h> -#include <rte_common.h> -#include <rte_dev.h> -#include <rte_eal.h> -#include <rte_ether.h> -#include <rte_ethdev_driver.h> #include <rte_ethdev_pci.h> #include <rte_io.h> -#include <rte_pci.h> #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 a4e552b..e2f0468 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 <stdbool.h> #include <rte_ethdev.h> #include <rte_io.h> #include <rte_malloc.h> -#include <rte_memcpy.h> -#include <rte_spinlock.h> #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 4e17b12..85316ca 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 <stdarg.h> -#include <stdbool.h> -#include <stdint.h> -#include <stdio.h> -#include <unistd.h> -#include <inttypes.h> #include <rte_bus_pci.h> -#include <rte_byteorder.h> #include <rte_common.h> #include <rte_cycles.h> -#include <rte_dev.h> -#include <rte_eal.h> -#include <rte_ether.h> #include <rte_vxlan.h> #include <rte_ethdev_driver.h> #include <rte_io.h> -#include <rte_ip.h> -#include <rte_gre.h> #include <rte_net.h> #include <rte_malloc.h> -#include <rte_pci.h> #if defined(RTE_ARCH_ARM64) && defined(CC_SVE_SUPPORT) #include <rte_cpuflags.h> #endif diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h index 51504ca..8b32abe 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 <stdint.h> +#include <rte_mbuf_core.h> + #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 ece07a4..c590647 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 <stdbool.h> -#include <stdint.h> -#include <rte_common.h> #include <rte_ethdev.h> #include <rte_io.h> #include <rte_malloc.h> -#include <rte_spinlock.h> #include "hns3_ethdev.h" #include "hns3_rxtx.h" -- 2.7.4