From 944127d1ed5b5d7a8c917817c74b37680c84f127 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sat, 14 Feb 2015 09:59:07 -0500 Subject: [PATCH] eal/bsd: remove useless assignments If variable is set in the next line, it doesn't need to be initialized. Signed-off-by: Stephen Hemminger --- lib/librte_eal/bsdapp/eal/eal.c | 3 ++- lib/librte_eal/bsdapp/eal/eal_pci.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 44f9d421fb..0e67471ecb 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -422,7 +422,8 @@ int rte_eal_has_hugepages(void) int rte_eal_iopl_init(void) { - int fd = -1; + int fd; + fd = open("/dev/io", O_RDWR); if (fd < 0) return -1; diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index 9193f8004a..e692b35ba9 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -379,7 +379,7 @@ skipdev: static int pci_scan(void) { - int fd = -1; + int fd; unsigned dev_count = 0; struct pci_conf matches[16]; struct pci_conf_io conf_io = { -- 2.20.1