[dpdk-stable] [PATCH] pci: fix unneeded includes in public header file
Bruce Richardson
bruce.richardson at intel.com
Mon Mar 16 12:29:51 CET 2020
The rte_pci.h file includes more header files than are actually needed,
which means that all users of it also include those headers. This patch
removes the unneeded headers - adding them elsewhere where other components
were requiring them but not including them directly.
Fixes: c752998b5e2e ("pci: introduce library and driver")
Cc: gaetan.rivet at 6wind.com
Cc: stable at dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/bus/ifpga/rte_bus_ifpga.h | 1 +
drivers/common/mlx5/mlx5_common.h | 1 +
lib/librte_pci/rte_pci.h | 6 ------
3 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/bus/ifpga/rte_bus_ifpga.h b/drivers/bus/ifpga/rte_bus_ifpga.h
index 88a628964..a6eeaaf56 100644
--- a/drivers/bus/ifpga/rte_bus_ifpga.h
+++ b/drivers/bus/ifpga/rte_bus_ifpga.h
@@ -17,6 +17,7 @@ extern "C" {
#include <rte_bus.h>
#include <rte_pci.h>
+#include <rte_interrupts.h>
#include <rte_spinlock.h>
/** Name of Intel FPGA Bus */
diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index 961c60634..16de1b397 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <rte_pci.h>
+#include <rte_debug.h>
#include <rte_atomic.h>
#include <rte_log.h>
#include <rte_kvargs.h>
diff --git a/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h
index c87891405..c591af010 100644
--- a/lib/librte_pci/rte_pci.h
+++ b/lib/librte_pci/rte_pci.h
@@ -16,17 +16,11 @@
extern "C" {
#endif
-#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
-#include <errno.h>
#include <sys/queue.h>
-#include <stdint.h>
#include <inttypes.h>
-#include <rte_debug.h>
-#include <rte_interrupts.h>
-
/** Formatting string for PCI device identifier: Ex: 0000:00:01.0 */
#define PCI_PRI_FMT "%.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8
#define PCI_PRI_STR_SIZE sizeof("XXXXXXXX:XX:XX.X")
--
2.20.1
More information about the stable
mailing list