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] eal: pci probe and adjust_config should be void
Date: Fri, 17 Apr 2015 08:35:34 -0700	[thread overview]
Message-ID: <1429284934-3261-3-git-send-email-stephen@networkplumber.org> (raw)
In-Reply-To: <1429284934-3261-1-git-send-email-stephen@networkplumber.org>

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

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 8fcb1ab..f47b401 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -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
diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 808b87b..93c8e84 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -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 */
diff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h
index f6714d9..59a0f39 100644
--- a/lib/librte_eal/common/eal_options.h
+++ b/lib/librte_eal/common/eal_options.h
@@ -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);
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..e2a5468 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -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;
 }
-- 
2.1.4

  parent reply	other threads:[~2015-04-17 15:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17 15:35 [dpdk-dev] [PATCH 0/2] functions with useless return Stephen Hemminger
2015-04-17 15:35 ` [dpdk-dev] [PATCH 1/2] log: rte_openlog_stream should be void Stephen Hemminger
2015-05-19 10:24   ` Bruce Richardson
2015-07-30  0:35     ` Stephen Hemminger
2015-04-17 15:35 ` Stephen Hemminger [this message]
2015-04-20 13:14   ` [dpdk-dev] [PATCH 2/2] eal: pci probe and adjust_config " Thomas Monjalon
2015-04-17 15:53 ` [dpdk-dev] [PATCH 0/2] functions with useless return Neil Horman

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=1429284934-3261-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).