From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 475F8B6D for ; Thu, 26 Jan 2017 05:41:43 +0100 (CET) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id v0Q4feRU031322; Wed, 25 Jan 2017 20:41:41 -0800 Date: Thu, 26 Jan 2017 10:11:24 +0530 From: Rahul Lakkireddy To: Ferruh Yigit , Emmanuel Roullit Cc: "dev@dpdk.org" , Kumar Sanghvi , Nirranjan Kirubaharan Message-ID: <20170126044123.GA6590@chelsio.com> References: <20170124204859.8998-1-emmanuel.roullit@gmail.com> <20170124204859.8998-2-emmanuel.roullit@gmail.com> <4742eebd-1712-db20-26b0-d2a8e1f9aaf8@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4742eebd-1712-db20-26b0-d2a8e1f9aaf8@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] [PATCH 2/3] net/cxgbe: remove unused variable usage X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2017 04:41:43 -0000 On Wednesday, January 01/25/17, 2017 at 17:43:57 +0530, Ferruh Yigit wrote: > On 1/24/2017 8:48 PM, Emmanuel Roullit wrote: > > Found with clang static analysis: > > drivers/net/cxgbe/sge.c:900:3: warning: > > Value stored to 'in_use' is never read > > in_use += q->size; > > ^ ~~~~~~~ > > > > Fixes: c167acb61278 ("net/cxgbe: use I/O device memory read/write API") This fixes line seems to be wrong. Should be: Fixes: 4a01078b4fd1 ("cxgbe: add Tx support") > > > > Signed-off-by: Emmanuel Roullit > > --- > > drivers/net/cxgbe/sge.c | 4 ---- > > 1 file changed, 4 deletions(-) > > > > diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c > > index fc03a0c26..42051ca01 100644 > > --- a/drivers/net/cxgbe/sge.c > > +++ b/drivers/net/cxgbe/sge.c > > @@ -891,14 +891,10 @@ static inline int should_tx_packet_coalesce(struct sge_eth_txq *txq, > > unsigned int flits, ndesc; > > unsigned char type = 0; > > int credits, hw_cidx = ntohs(q->stat->cidx); > > - int in_use = q->pidx - hw_cidx + flits_to_desc(q->coalesce.flits); > > > > /* use coal WR type 1 when no frags are present */ > > type = (mbuf->nb_segs == 1) ? 1 : 0; > > > > - if (in_use < 0) > > - in_use += q->size; > > Intention can be "q->in_use" here. That change can be proper fix instead > of removing. > > I will wait for maintainers comment to get the patch. > in_use can be removed. Also, Patch 2 and 3 can be merged. > > - > > if (unlikely(type != q->coalesce.type && q->coalesce.idx)) > > ship_tx_pkt_coalesce_wr(adap, txq); > > > > > Thanks, Rahul