From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] pci: make rte_pci_probe void
Date: Tue, 14 Apr 2015 10:55:36 -0700 [thread overview]
Message-ID: <1429034136-13482-1-git-send-email-stephen@networkplumber.org> (raw)
Since rte_pci_probe always returns 0 or exits via rte_exit()
there is no point in having it return a value.
Just make it void
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/bsdapp/eal/eal.c | 3 +--
lib/librte_eal/common/eal_common_pci.c | 9 +++------
lib/librte_eal/common/include/rte_pci.h | 6 +-----
lib/librte_eal/linuxapp/eal/eal.c | 3 +--
4 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index 871d5f4..9a9ada2 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -551,8 +551,7 @@ rte_eal_init(int argc, char **argv)
rte_eal_mp_wait_lcore();
/* Probe & Initialize PCI devices */
- if (rte_eal_pci_probe())
- rte_panic("Cannot probe PCI\n");
+ rte_eal_pci_probe();
return fctret;
}
diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 808b87b..dbb4c92 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -223,13 +223,13 @@ err_return:
* all registered drivers that have a matching entry in its id_table
* for discovered devices.
*/
-int
+void
rte_eal_pci_probe(void)
{
struct rte_pci_device *dev = NULL;
struct rte_devargs *devargs;
int probe_all = 0;
- int ret = 0;
+ int ret;
if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) == 0)
probe_all = 1;
@@ -252,12 +252,10 @@ rte_eal_pci_probe(void)
" cannot be used\n", dev->addr.domain, dev->addr.bus,
dev->addr.devid, dev->addr.function);
}
-
- return 0;
}
/* dump one device */
-static int
+static void
pci_dump_one_device(FILE *f, struct rte_pci_device *dev)
{
int i;
@@ -273,7 +271,6 @@ pci_dump_one_device(FILE *f, struct rte_pci_device *dev)
dev->mem_resource[i].phys_addr,
dev->mem_resource[i].len);
}
- return 0;
}
/* dump devices on the bus */
diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h
index 785852d..052d3da 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -327,12 +327,8 @@ int rte_eal_pci_scan(void);
* Scan the content of the PCI bus, and call the probe() function for
* all registered drivers that have a matching entry in its id_table
* for discovered devices.
- *
- * @return
- * - 0 on success.
- * - Negative on error.
*/
-int rte_eal_pci_probe(void);
+void rte_eal_pci_probe(void);
#ifdef RTE_LIBRTE_EAL_HOTPLUG
/**
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index bd770cf..bd7ac62 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -842,8 +842,7 @@ rte_eal_init(int argc, char **argv)
rte_eal_mp_wait_lcore();
/* Probe & Initialize PCI devices */
- if (rte_eal_pci_probe())
- rte_panic("Cannot probe PCI\n");
+ rte_eal_pci_probe();
return fctret;
}
--
2.1.4
next reply other threads:[~2015-04-14 17:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-14 17:55 Stephen Hemminger [this message]
2015-04-20 13:15 ` Thomas Monjalon
2015-07-30 0:34 ` Stephen Hemminger
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=1429034136-13482-1-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).