Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci #ifdef variable declarations/initializations lik...



details:   https://anonhg.NetBSD.org/src/rev/d0f7d82a3f4f
branches:  trunk
changeset: 789936:d0f7d82a3f4f
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Sep 13 20:54:14 2013 +0000

description:
#ifdef variable declarations/initializations like their use

diffstat:

 sys/dev/pci/if_bnx.c |  19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diffs (61 lines):

diff -r 65a755c91902 -r d0f7d82a3f4f sys/dev/pci/if_bnx.c
--- a/sys/dev/pci/if_bnx.c      Fri Sep 13 20:51:20 2013 +0000
+++ b/sys/dev/pci/if_bnx.c      Fri Sep 13 20:54:14 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bnx.c,v 1.48 2013/03/30 03:21:03 christos Exp $     */
+/*     $NetBSD: if_bnx.c,v 1.49 2013/09/13 20:54:14 martin Exp $       */
 /*     $OpenBSD: if_bnx.c,v 1.85 2009/11/09 14:32:41 dlg Exp $ */
 
 /*-
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.48 2013/03/30 03:21:03 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.49 2013/09/13 20:54:14 martin Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -5006,7 +5006,9 @@
        struct bnx_softc        *sc = ifp->if_softc;
        struct mbuf             *m_head = NULL;
        int                     count = 0;
-       u_int16_t               tx_prod, tx_chain_prod;
+#ifdef BNX_DEBUG
+       u_int16_t               tx_chain_prod;
+#endif
 
        /* If there's no link or the transmit queue is empty then just exit. */
        if ((ifp->if_flags & (IFF_OACTIVE|IFF_RUNNING)) != IFF_RUNNING) {
@@ -5016,13 +5018,14 @@
        }
 
        /* prod points to the next free tx_bd. */
-       tx_prod = sc->tx_prod;
-       tx_chain_prod = TX_CHAIN_IDX(tx_prod);
+#ifdef BNX_DEBUG
+       tx_chain_prod = TX_CHAIN_IDX(sc->tx_prod);
+#endif
 
        DBPRINT(sc, BNX_INFO_SEND, "%s(): Start: tx_prod = 0x%04X, "
            "tx_chain_prod = %04X, tx_prod_bseq = 0x%08X, "
            "used_tx %d max_tx %d\n",
-           __func__, tx_prod, tx_chain_prod, sc->tx_prod_bseq,
+           __func__, sc->tx_prod, tx_chain_prod, sc->tx_prod_bseq,
            sc->used_tx_bd, sc->max_tx_bd);
 
        /*
@@ -5062,10 +5065,12 @@
        }
 
        /* Update the driver's counters. */
+#ifdef BNX_DEBUG
        tx_chain_prod = TX_CHAIN_IDX(sc->tx_prod);
+#endif
 
        DBPRINT(sc, BNX_INFO_SEND, "%s(): End: tx_prod = 0x%04X, tx_chain_prod "
-           "= 0x%04X, tx_prod_bseq = 0x%08X\n", __func__, tx_prod,
+           "= 0x%04X, tx_prod_bseq = 0x%08X\n", __func__, sc->tx_prod,
            tx_chain_prod, sc->tx_prod_bseq);
 
        /* Start the transmit. */



Home | Main Index | Thread Index | Old Index