[dpdk-dev,2/2] pci: allow const for rte_pci_addr
Commit Message
probe and close both don't modify the rte_pci_addr structure
that is passed.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/common/eal_common_pci.c | 4 ++--
lib/librte_eal/common/include/rte_pci.h | 7 ++++---
2 files changed, 6 insertions(+), 5 deletions(-)
@@ -158,7 +158,7 @@ pci_close_all_drivers(struct rte_pci_device *dev)
* the driver of the devive.
*/
int
-rte_eal_pci_probe_one(struct rte_pci_addr *addr)
+rte_eal_pci_probe_one(const struct rte_pci_addr *addr)
{
struct rte_pci_device *dev = NULL;
int ret = 0;
@@ -189,7 +189,7 @@ err_return:
* the driver of the devive.
*/
int
-rte_eal_pci_close_one(struct rte_pci_addr *addr)
+rte_eal_pci_close_one(const struct rte_pci_addr *addr)
{
struct rte_pci_device *dev = NULL;
int ret = 0;
@@ -292,7 +292,8 @@ eal_parse_pci_DomBDF(const char *input, struct rte_pci_addr *dev_addr)
* Negative on addr is less than addr2, or error.
*/
static inline int
-rte_eal_compare_pci_addr(struct rte_pci_addr *addr, struct rte_pci_addr *addr2)
+rte_eal_compare_pci_addr(const struct rte_pci_addr *addr,
+ const struct rte_pci_addr *addr2)
{
uint64_t dev_addr, dev_addr2;
@@ -348,7 +349,7 @@ int rte_eal_pci_probe(void);
* - 0 on success.
* - Negative on error.
*/
-int rte_eal_pci_probe_one(struct rte_pci_addr *addr);
+int rte_eal_pci_probe_one(const struct rte_pci_addr *addr);
/**
* Close the single PCI device.
@@ -363,7 +364,7 @@ int rte_eal_pci_probe_one(struct rte_pci_addr *addr);
* - 0 on success.
* - Negative on error.
*/
-int rte_eal_pci_close_one(struct rte_pci_addr *addr);
+int rte_eal_pci_close_one(const struct rte_pci_addr *addr);
#endif /* RTE_LIBRTE_EAL_HOTPLUG */
/**