From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH 3/6] bsd: remove useless assignments Date: Mon, 16 Feb 2015 11:31:12 +0000 Message-ID: <20150216113111.GA18784@bricha3-MOBL3> References: <1423925950-5201-1-git-send-email-shemming@brocade.com> <1423925950-5201-3-git-send-email-shemming@brocade.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev-VfR2kkLFssw@public.gmane.org, Stephen Hemminger To: Stephen Hemminger Return-path: Content-Disposition: inline In-Reply-To: <1423925950-5201-3-git-send-email-shemming-43mecJUBy8ZBDgjK7y7TUQ@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On Sat, Feb 14, 2015 at 09:59:07AM -0500, Stephen Hemminger wrote: > 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 69f3c03..71ae33c 100644 > --- a/lib/librte_eal/bsdapp/eal/eal.c > +++ b/lib/librte_eal/bsdapp/eal/eal.c > @@ -417,7 +417,8 @@ int rte_eal_has_hugepages(void) > int > rte_eal_iopl_init(void) > { > - int fd = -1; > + int fd; > + > fd = open("/dev/io", O_RDWR); Why not just merge the two lines and make it "int fd = open(...);". /Bruce