[dpdk-dev,2/2] eal: pci probe and adjust_config should be void
Commit Message
This functions always returned 0 and therefore should be void.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/common/eal_common_options.c | 3 +--
lib/librte_eal/common/eal_common_pci.c | 7 ++-----
lib/librte_eal/common/eal_options.h | 2 +-
lib/librte_eal/common/include/rte_pci.h | 6 +-----
lib/librte_eal/linuxapp/eal/eal.c | 6 ++----
5 files changed, 7 insertions(+), 17 deletions(-)
Comments
2015-04-17 08:35, Stephen Hemminger:
> This functions always returned 0 and therefore should be void.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> lib/librte_eal/common/eal_common_options.c | 3 +--
> lib/librte_eal/common/eal_common_pci.c | 7 ++-----
> lib/librte_eal/common/eal_options.h | 2 +-
> lib/librte_eal/common/include/rte_pci.h | 6 +-----
> lib/librte_eal/linuxapp/eal/eal.c | 6 ++----
> 5 files changed, 7 insertions(+), 17 deletions(-)
Why bsdapp is not changed?
You posted a similar patch few days before which was modifying bsdapp:
http://dpdk.org/dev/patchwork/patch/4306/
@@ -794,7 +794,7 @@ eal_parse_common_option(int opt, const char *optarg,
return 0;
}
-int
+void
eal_adjust_config(struct internal_config *internal_cfg)
{
int i;
@@ -812,7 +812,6 @@ eal_adjust_config(struct internal_config *internal_cfg)
for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
internal_cfg->memory += internal_cfg->socket_mem[i];
- return 0;
}
int
@@ -223,7 +223,7 @@ 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;
@@ -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 */
@@ -89,7 +89,7 @@ extern const struct option eal_long_options[];
int eal_parse_common_option(int opt, const char *argv,
struct internal_config *conf);
-int eal_adjust_config(struct internal_config *internal_cfg);
+void eal_adjust_config(struct internal_config *internal_cfg);
int eal_check_common_options(struct internal_config *internal_cfg);
void eal_common_usage(void);
enum rte_proc_type_t eal_proc_type_detect(void);
@@ -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
/**
@@ -621,8 +621,7 @@ eal_parse_args(int argc, char **argv)
}
}
- if (eal_adjust_config(&internal_config) != 0)
- return -1;
+ eal_adjust_config(&internal_config);
/* sanity checks */
if (eal_check_common_options(&internal_config) != 0) {
@@ -842,8 +841,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;
}