net/cxgbe: remove unused variables
authorEmmanuel Roullit <emmanuel.roullit@gmail.com>
Tue, 24 Jan 2017 20:48:58 +0000 (21:48 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 30 Jan 2017 21:18:26 +0000 (22:18 +0100)
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;
        ^         ~~~~~~~

Removing "in_use" variable makes "hw_cidx" variable unused, which is
removed too.

Fixes: 4a01078b4fd1 ("cxgbe: add Tx support")
Cc: stable@dpdk.org
Signed-off-by: Emmanuel Roullit <emmanuel.roullit@gmail.com>
Acked-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
drivers/net/cxgbe/sge.c

index fc03a0c..37b6090 100644 (file)
@@ -890,15 +890,11 @@ static inline int should_tx_packet_coalesce(struct sge_eth_txq *txq,
        struct sge_txq *q = &txq->q;
        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);
+       int credits;
 
        /* 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;
-
        if (unlikely(type != q->coalesce.type && q->coalesce.idx))
                ship_tx_pkt_coalesce_wr(adap, txq);