Hi,

I've made a mistake when refactoring txp_start recently.
firstprod and firstcnt served one purpose only: they cached the
value of prod and cnt at the start of the loop and then if they'd
get incremented but we'd have to bail and goto the oactive label
we'd restore the r_prod and r_cnt to values from before the
increment.  Now that we don't bail where we used to after the
refactoring, we don't need to cache them anymore and can safely
use prod and cnt.

OK?

diff --git sys/dev/pci/if_txp.c sys/dev/pci/if_txp.c
index 9ea9b359832..3529e44cef1 100644
--- sys/dev/pci/if_txp.c
+++ sys/dev/pci/if_txp.c
@@ -1263,11 +1263,11 @@ txp_start(struct ifnet *ifp)
        struct txp_tx_desc *txd;
        int txdidx;
        struct txp_frag_desc *fxd;
        struct mbuf *m;
        struct txp_swdesc *sd;
-       u_int32_t firstprod, firstcnt, prod, cnt, i;
+       u_int32_t prod, cnt, i;
 
        if (!(ifp->if_flags & IFF_RUNNING) || ifq_is_oactive(&ifp->if_snd))
                return;
 
        prod = r->r_prod;
@@ -1279,13 +1279,10 @@ txp_start(struct ifnet *ifp)
 
                m = ifq_dequeue(&ifp->if_snd);
                if (m == NULL)
                        break;
 
-               firstprod = prod;
-               firstcnt = cnt;
-
                sd = sc->sc_txd + prod;
                sd->sd_mbuf = m;
 
                switch (bus_dmamap_load_mbuf(sc->sc_dmat, sd->sd_map, m,
                    BUS_DMA_NOWAIT)) {
@@ -1399,12 +1396,12 @@ txp_start(struct ifnet *ifp)
        r->r_cnt = cnt;
        return;
 
 oactive:
        ifq_set_oactive(&ifp->if_snd);
-       r->r_prod = firstprod;
-       r->r_cnt = firstcnt;
+       r->r_prod = prod;
+       r->r_cnt = cnt;
 }
 
 /*
  * Handle simple commands sent to the typhoon
  */

Reply via email to