patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] pci: fix unneeded includes in public header file
@ 2020-03-16 11:29 Bruce Richardson
  2020-03-16 14:30 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Bruce Richardson @ 2020-03-16 11:29 UTC (permalink / raw)
  To: dev; +Cc: thomas, Dmitry Kozlyuk, Bruce Richardson, gaetan.rivet, stable

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@6wind.com
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] pci: fix unneeded includes in public header file
  2020-03-16 11:29 [dpdk-stable] [PATCH] pci: fix unneeded includes in public header file Bruce Richardson
@ 2020-03-16 14:30 ` " Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2020-03-16 14:30 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Dmitry Kozlyuk, gaetan.rivet, stable

16/03/2020 12:29, Bruce Richardson:
> 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@6wind.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
[...]
> --- a/lib/librte_pci/rte_pci.h
> +++ b/lib/librte_pci/rte_pci.h
> -#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>

Removing useless includes (or lines in general) is always good.

Acked-by: Thomas Monjalon <thomas@monjalon.net>

Applied, thanks



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-16 11:29 [dpdk-stable] [PATCH] pci: fix unneeded includes in public header file Bruce Richardson
2020-03-16 14:30 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox