[dpdk-dev] [PATCH 07/19] pmd: remove dead code

Neil Horman nhorman at tuxdriver.com
Thu Apr 10 22:49:57 CEST 2014


Now that we've converted the available PMD drivers to use the PMD_INIT_NONPCI
macro, we can remove the rest of the old init code

Signed-off-by: Neil Horman <nhorman at tuxdriver.com>
---
 lib/librte_eal/common/eal_common_nonpci_devs.c | 34 +-------------------------
 1 file changed, 1 insertion(+), 33 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_nonpci_devs.c b/lib/librte_eal/common/eal_common_nonpci_devs.c
index c65621e..78bedf3 100644
--- a/lib/librte_eal/common/eal_common_nonpci_devs.c
+++ b/lib/librte_eal/common/eal_common_nonpci_devs.c
@@ -44,19 +44,6 @@
 #include <rte_log.h>
 #include "eal_private.h"
 
-struct device_init {
-	const char *dev_prefix;
-	int (*init_fn)(const char*, const char *);
-};
-
-#define NUM_DEV_TYPES (sizeof(dev_types)/sizeof(dev_types[0]))
-struct device_init dev_types[] = {
-		{
-			.dev_prefix = "-nodev-",
-			.init_fn = NULL
-		}
-};
-
 TAILQ_HEAD(pmd_nonpci_list, pmd_nonpci_entry);
 
 /* Definition for shared object drivers. */
@@ -96,31 +83,12 @@ rte_eal_non_pci_ethdev_init(void)
 {
 	struct rte_devargs *devargs;
 	struct pmd_nonpci_entry *entry;
-	uint8_t i;
-	int found = 0;
+	int found;
 
-	/* call the init function for each virtual device */
 	TAILQ_FOREACH(devargs, &devargs_list, next) {
-
 		if (devargs->type != RTE_DEVTYPE_VIRTUAL)
 			continue;
 		found = 0;
-
-		for (i = 0; i < NUM_DEV_TYPES; i++) {
-			/* search a driver prefix in virtual device name */
-			if (!strncmp(dev_types[i].dev_prefix,
-				    devargs->virtual.drv_name,
-				     sizeof(dev_types[i].dev_prefix) - 1)) {
-				dev_types[i].init_fn(devargs->virtual.drv_name,
-						     devargs->args);
-				found = 1;
-				break;
-			}
-		}
-
-		if (found)
-			continue;
-
 		TAILQ_FOREACH(entry, &pmd_nonpci_init_list, next) {
 			if (!entry->name)
 				continue;
-- 
1.8.3.1



More information about the dev mailing list