[dpdk-dev,3/7] eal: remove duplicate handling of white/black list
diff mbox

Message ID 1411375081-27986-4-git-send-email-david.marchand@6wind.com
State Accepted, archived
Headers show

Commit Message

David Marchand Sept. 22, 2014, 8:37 a.m. UTC
We can handle both short and long options for those in the same case.

Signed-off-by: David Marchand <david.marchand@6wind.com>
---
 lib/librte_eal/bsdapp/eal/eal.c   |   18 ++----------------
 lib/librte_eal/linuxapp/eal/eal.c |   18 ++----------------
 2 files changed, 4 insertions(+), 32 deletions(-)

Patch
diff mbox

diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index 7e9f3aa..8599a35 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -513,8 +513,8 @@  eal_parse_args(int argc, char **argv)
 		{OPT_PROC_TYPE, 1, 0, 0},
 		{OPT_FILE_PREFIX, 1, 0, 0},
 		{OPT_SOCKET_MEM, 1, 0, 0},
-		{OPT_PCI_WHITELIST, 1, 0, 0},
-		{OPT_PCI_BLACKLIST, 1, 0, 0},
+		{OPT_PCI_WHITELIST, 1, 0, 'w'},
+		{OPT_PCI_BLACKLIST, 1, 0, 'b'},
 		{OPT_VDEV, 1, 0, 0},
 		{OPT_SYSLOG, 1, NULL, 0},
 		{OPT_LOG_LEVEL, 1, NULL, 0},
@@ -629,20 +629,6 @@  eal_parse_args(int argc, char **argv)
 			else if (!strcmp(lgopts[option_index].name, OPT_PROC_TYPE)) {
 				internal_config.process_type = eal_parse_proc_type(optarg);
 			}
-			else if (!strcmp(lgopts[option_index].name, OPT_PCI_BLACKLIST)) {
-				if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI,
-						optarg) < 0) {
-					eal_usage(prgname);
-					return -1;
-				}
-			}
-			else if (!strcmp(lgopts[option_index].name, OPT_PCI_WHITELIST)) {
-				if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI,
-						optarg) < 0) {
-					eal_usage(prgname);
-					return -1;
-				}
-			}
 			else if (!strcmp(lgopts[option_index].name, OPT_VDEV)) {
 				if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL,
 						optarg) < 0) {
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index bf63744..655c454 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -718,8 +718,8 @@  eal_parse_args(int argc, char **argv)
 		{OPT_PROC_TYPE, 1, 0, 0},
 		{OPT_FILE_PREFIX, 1, 0, 0},
 		{OPT_SOCKET_MEM, 1, 0, 0},
-		{OPT_PCI_WHITELIST, 1, 0, 0},
-		{OPT_PCI_BLACKLIST, 1, 0, 0},
+		{OPT_PCI_WHITELIST, 1, 0, 'w'},
+		{OPT_PCI_BLACKLIST, 1, 0, 'b'},
 		{OPT_VDEV, 1, 0, 0},
 		{OPT_SYSLOG, 1, NULL, 0},
 		{OPT_LOG_LEVEL, 1, NULL, 0},
@@ -879,20 +879,6 @@  eal_parse_args(int argc, char **argv)
 					return -1;
 				}
 			}
-			else if (!strcmp(lgopts[option_index].name, OPT_PCI_BLACKLIST)) {
-				if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI,
-						optarg) < 0) {
-					eal_usage(prgname);
-					return -1;
-				}
-			}
-			else if (!strcmp(lgopts[option_index].name, OPT_PCI_WHITELIST)) {
-				if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI,
-						optarg) < 0) {
-					eal_usage(prgname);
-					return -1;
-				}
-			}
 			else if (!strcmp(lgopts[option_index].name, OPT_VDEV)) {
 				if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL,
 						optarg) < 0) {