dev: hide internal type for device comparison
PATCH 1/1 dev: hide internal type for device comparison
rte_dev_cmp_t is a type used only in bus operations. Since no public API references it, remove it from exported types. Thanks to this, we can remove the dependency of bus_driver.h to rte_dev.h.
Signed-off-by David Marchand <[email protected]>
--- app/test/test_vdev.c | 1 + lib/eal/include/bus_driver.h | 24 +++++++++++++++++++++++- lib/eal/include/rte_dev.h | 21 --------------------- 3 files changed, 24 insertions(+), 22 deletions(-)
app/test/test_vdev.c +1 -0
@@ -7,6 +7,7 @@#include <string.h> #include <rte_common.h> +#include <rte_dev.h> #include <rte_kvargs.h> #include <bus_driver.h> #include <rte_bus_vdev.h>
lib/eal/include/bus_driver.h +23 -1
@@ -7,7 +7,6 @@#include <rte_bus.h> #include <rte_compat.h> -#include <rte_dev.h> #include <rte_eal.h> #include <rte_tailq.h>
@@ -15,8 +14,10 @@extern "C" {#endif +struct rte_dev_iterator ;struct rte_devargs ;struct rte_device ; +struct rte_driver ;/** Double linked list of buses */ RTE_TAILQ_HEAD (rte_bus_list, rte_bus);
@@ -49,6 +50,27 @@ typedef int (*rte_bus_scan_t)(void);*/ typedef int (*rte_bus_probe_t )(struct rte_bus *bus); +/** +* Device comparison function. +* +* This type of function is used to compare an rte_device with arbitrary +* data. +* +* @param dev +* Device handle. +* +* @param data +* Data to compare against. The type of this parameter is determined by +* the kind of comparison performed by the function. +* +* @return +* 0 if the device matches the data. +* !0 if the device does not match. +* <0 if ordering is possible and the device is lower than the data. +* >0 if ordering is possible and the device is greater than the data. +*/ +typedef int (*rte_dev_cmp_t )(const struct rte_device *dev,const void *data); +/** * Device iterator to find a device on a bus. *
lib/eal/include/rte_dev.h +0 -21
@@ -211,27 +211,6 @@ int rte_eal_hotplug_remove(const char *busname, const char *devname);*/ int rte_dev_remove (struct rte_device *dev); -/** -* Device comparison function. -* -* This type of function is used to compare an rte_device with arbitrary -* data. -* -* @param dev -* Device handle. -* -* @param data -* Data to compare against. The type of this parameter is determined by -* the kind of comparison performed by the function. -* -* @return -* 0 if the device matches the data. -* !0 if the device does not match. -* <0 if ordering is possible and the device is lower than the data. -* >0 if ordering is possible and the device is greater than the data. -*/ -typedef int (*rte_dev_cmp_t )(const struct rte_device *dev,const void *data); -/** * Iteration context. *
Signature · 1 line
2.54.0
Quoted 7 lines · David Marchand
rte_dev_cmp_tis a type used only in bus operations. Since no public API references it, remove it from exported types. Thanks to this, we can remove the dependency ofbus_driver.htorte_dev.h.Signed-off-by David Marchand <[email protected]>---
Acked-by Bruce Richardson <[email protected]>
David Marchand
AppliedQuoted 9 lines · Bruce Richardson
Quoted 6 lines · David Marchand
rte_dev_cmp_tis a type used only in bus operations. Since no public API references it, remove it from exported types. Thanks to this, we can remove the dependency ofbus_driver.htorte_dev.h.Signed-off-by David Marchand <[email protected]>Acked-by Bruce Richardson <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand