DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/2] pci: allow const for rte_pci_addr
Date: Thu, 16 Apr 2015 16:23:40 -0700	[thread overview]
Message-ID: <1429226620-9847-3-git-send-email-stephen@networkplumber.org> (raw)
In-Reply-To: <1429226620-9847-1-git-send-email-stephen@networkplumber.org>

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(-)

diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 808b87b..4229aaf 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -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;
diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h
index 62449d7..223d3cd 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -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 */
 
 /**
-- 
2.1.4

  parent reply	other threads:[~2015-04-16 23:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16 23:23 [dpdk-dev] [PATCH 0/2] PCI cleanups Stephen Hemminger
2015-04-16 23:23 ` [dpdk-dev] [PATCH 1/2] pci: make device_id tables const Stephen Hemminger
2015-04-16 23:23 ` Stephen Hemminger [this message]
2015-04-17 11:12 ` [dpdk-dev] [PATCH 0/2] PCI cleanups Neil Horman
2015-04-23 12:51   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1429226620-9847-3-git-send-email-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).