From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 676DFB5BE for ; Mon, 16 Feb 2015 12:31:17 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 16 Feb 2015 03:27:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,587,1418112000"; d="scan'208";a="652756966" Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.26]) by orsmga001.jf.intel.com with SMTP; 16 Feb 2015 03:31:13 -0800 Received: by (sSMTP sendmail emulation); Mon, 16 Feb 2015 11:31:12 +0025 Date: Mon, 16 Feb 2015 11:31:12 +0000 From: Bruce Richardson To: Stephen Hemminger 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 Content-Disposition: inline In-Reply-To: <1423925950-5201-3-git-send-email-shemming@brocade.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org, Stephen Hemminger Subject: Re: [dpdk-dev] [PATCH 3/6] bsd: remove useless assignments X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2015 11:31:17 -0000 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