From: David Marchand Date: Mon, 22 Sep 2014 08:37:57 +0000 (+0200) Subject: eal: remove duplicate handling of white/black list X-Git-Tag: spdx-start~10397 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=58a0cae3657764ecc6b5ecd88668fec21a342c75;p=dpdk.git eal: remove duplicate handling of white/black list We can handle both short and long options for those in the same case. Signed-off-by: David Marchand Acked-by: Neil Horman --- diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 7e9f3aa518..8599a3533d 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 bf637440b3..655c45429f 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) {