Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci - remove unused variables



details:   https://anonhg.NetBSD.org/src/rev/c0c814124c29
branches:  trunk
changeset: 790574:c0c814124c29
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Oct 17 21:06:15 2013 +0000

description:
- remove unused variables
- move debugging code inside debugging sections

diffstat:

 sys/dev/pci/if_dge.c     |   7 +++----
 sys/dev/pci/if_ipw.c     |  11 +++++------
 sys/dev/pci/if_iwi.c     |  21 ++++++++++++---------
 sys/dev/pci/if_iwn.c     |   7 +++----
 sys/dev/pci/if_jme.c     |   6 ++----
 sys/dev/pci/ld_twa.c     |   6 ++----
 sys/dev/pci/mly.c        |  10 +++++-----
 sys/dev/pci/mpii.c       |   6 ++----
 sys/dev/pci/pccbb.c      |  23 ++++++++---------------
 sys/dev/pci/twa.c        |  11 +++++------
 sys/dev/pci/viomb.c      |   7 +++----
 sys/dev/pci/weasel_pci.c |  10 ++++------
 12 files changed, 54 insertions(+), 71 deletions(-)

diffs (truncated from 547 to 300 lines):

diff -r d6b7200f78d2 -r c0c814124c29 sys/dev/pci/if_dge.c
--- a/sys/dev/pci/if_dge.c      Thu Oct 17 21:05:41 2013 +0000
+++ b/sys/dev/pci/if_dge.c      Thu Oct 17 21:06:15 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_dge.c,v 1.35 2012/10/27 17:18:32 chs Exp $ */
+/*     $NetBSD: if_dge.c,v 1.36 2013/10/17 21:06:15 christos Exp $ */
 
 /*
  * Copyright (c) 2004, SUNET, Swedish University Computer Network.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.35 2012/10/27 17:18:32 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.36 2013/10/17 21:06:15 christos Exp $");
 
 
 
@@ -473,7 +473,7 @@
 static int
 dge_alloc_rcvmem(struct dge_softc *sc)
 {
-       char *ptr, *kva;
+       char *kva;
        bus_dma_segment_t seg;
        int i, rseg, state, error;
        struct rxbugentry *entry;
@@ -519,7 +519,6 @@
         * Now divide it up into DGE_BUFFER_SIZE pieces and save the addresses
         * in an array.
         */
-       ptr = sc->sc_bugbuf;
        if ((entry = malloc(sizeof(*entry) * DGE_NBUFFERS,
            M_DEVBUF, M_NOWAIT)) == NULL) {
                error = ENOBUFS;
diff -r d6b7200f78d2 -r c0c814124c29 sys/dev/pci/if_ipw.c
--- a/sys/dev/pci/if_ipw.c      Thu Oct 17 21:05:41 2013 +0000
+++ b/sys/dev/pci/if_ipw.c      Thu Oct 17 21:06:15 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ipw.c,v 1.54 2012/10/27 17:18:32 chs Exp $  */
+/*     $NetBSD: if_ipw.c,v 1.55 2013/10/17 21:06:15 christos Exp $     */
 /*     FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp         */
 
 /*-
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.54 2012/10/27 17:18:32 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.55 2013/10/17 21:06:15 christos Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2100 MiniPCI driver
@@ -886,16 +886,17 @@
 static void
 ipw_command_intr(struct ipw_softc *sc, struct ipw_soft_buf *sbuf)
 {
-       struct ipw_cmd *cmd;
 
        bus_dmamap_sync(sc->sc_dmat, sbuf->map, 0, sizeof (struct ipw_cmd),
            BUS_DMASYNC_POSTREAD);
 
-       cmd = mtod(sbuf->m, struct ipw_cmd *);
+#ifdef IPW_DEBUG
+       struct ipw_cmd *cmd = mtod(sbuf->m, struct ipw_cmd *);
 
        DPRINTFN(2, ("cmd ack'ed (%u, %u, %u, %u, %u)\n", le32toh(cmd->type),
            le32toh(cmd->subtype), le32toh(cmd->seq), le32toh(cmd->len),
            le32toh(cmd->status)));
+#endif
 
        wakeup(&sc->cmd);
 }
@@ -1152,7 +1153,6 @@
 static void
 ipw_release_sbd(struct ipw_softc *sc, struct ipw_soft_bd *sbd)
 {
-       struct ieee80211com *ic;
        struct ipw_soft_hdr *shdr;
        struct ipw_soft_buf *sbuf;
 
@@ -1171,7 +1171,6 @@
                break;
 
        case IPW_SBD_TYPE_DATA:
-               ic = &sc->sc_ic;
                sbuf = sbd->priv;
 
                bus_dmamap_sync(sc->sc_dmat, sbuf->map,
diff -r d6b7200f78d2 -r c0c814124c29 sys/dev/pci/if_iwi.c
--- a/sys/dev/pci/if_iwi.c      Thu Oct 17 21:05:41 2013 +0000
+++ b/sys/dev/pci/if_iwi.c      Thu Oct 17 21:06:15 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iwi.c,v 1.92 2013/03/30 03:21:05 christos Exp $  */
+/*     $NetBSD: if_iwi.c,v 1.93 2013/10/17 21:06:15 christos Exp $  */
 /*     $OpenBSD: if_iwi.c,v 1.111 2010/11/15 19:11:57 damien Exp $     */
 
 /*-
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.92 2013/03/30 03:21:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.93 2013/10/17 21:06:15 christos Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
@@ -1233,25 +1233,29 @@
 iwi_notification_intr(struct iwi_softc *sc, struct iwi_notif *notif)
 {
        struct ieee80211com *ic = &sc->sc_ic;
-       struct iwi_notif_scan_channel *chan;
-       struct iwi_notif_scan_complete *scan;
        struct iwi_notif_authentication *auth;
        struct iwi_notif_association *assoc;
        struct iwi_notif_beacon_state *beacon;
 
        switch (notif->type) {
        case IWI_NOTIF_TYPE_SCAN_CHANNEL:
-               chan = (struct iwi_notif_scan_channel *)(notif + 1);
+#ifdef IWI_DEBUG
+               struct iwi_notif_scan_channel *chan =
+                   (struct iwi_notif_scan_channel *)(notif + 1);
 
                DPRINTFN(2, ("Scan of channel %u complete (%u)\n",
                    ic->ic_channels[chan->nchan].ic_freq, chan->nchan));
+#endif
                break;
 
        case IWI_NOTIF_TYPE_SCAN_COMPLETE:
-               scan = (struct iwi_notif_scan_complete *)(notif + 1);
+#ifdef IWI_DEBUG
+               struct iwi_notif_scan_complete *scan =
+                   (struct iwi_notif_scan_complete *)(notif + 1);
 
                DPRINTFN(2, ("Scan completed (%u, %u)\n", scan->nchan,
                    scan->status));
+#endif
 
                /* monitor mode uses scan to set the channel ... */
                if (ic->ic_opmode != IEEE80211_M_MONITOR) {
@@ -1333,9 +1337,8 @@
 static void
 iwi_cmd_intr(struct iwi_softc *sc)
 {
-       uint32_t hw;
-
-       hw = CSR_READ_4(sc, IWI_CSR_CMD_RIDX);
+
+       (void)CSR_READ_4(sc, IWI_CSR_CMD_RIDX);
 
        bus_dmamap_sync(sc->sc_dmat, sc->cmdq.desc_map,
            sc->cmdq.next * IWI_CMD_DESC_SIZE, IWI_CMD_DESC_SIZE,
diff -r d6b7200f78d2 -r c0c814124c29 sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c      Thu Oct 17 21:05:41 2013 +0000
+++ b/sys/dev/pci/if_iwn.c      Thu Oct 17 21:06:15 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iwn.c,v 1.69 2013/09/14 13:11:31 joerg Exp $        */
+/*     $NetBSD: if_iwn.c,v 1.70 2013/10/17 21:06:15 christos Exp $     */
 /*     $OpenBSD: if_iwn.c,v 1.119 2013/05/29 23:16:52 yuo Exp $        */
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.69 2013/09/14 13:11:31 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.70 2013/10/17 21:06:15 christos Exp $");
 
 #define IWN_USE_RBUF   /* Use local storage for RX */
 #undef IWN_HWCRYPTO    /* XXX does not even compile yet */
@@ -3115,7 +3115,6 @@
 {
        struct iwn_softc *sc = ifp->if_softc;
        struct ieee80211com *ic = &sc->sc_ic;
-       struct ifaddr *ifa;
        const struct sockaddr *sa;
        int s, error = 0;
 
@@ -3123,9 +3122,9 @@
 
        switch (cmd) {
        case SIOCSIFADDR:
-               ifa = (struct ifaddr *)data;
                ifp->if_flags |= IFF_UP;
 #ifdef INET
+               struct ifaddr *ifa = (struct ifaddr *)data;
                if (ifa->ifa_addr->sa_family == AF_INET)
                        arp_ifinit(&ic->ic_ac, ifa);
 #endif
diff -r d6b7200f78d2 -r c0c814124c29 sys/dev/pci/if_jme.c
--- a/sys/dev/pci/if_jme.c      Thu Oct 17 21:05:41 2013 +0000
+++ b/sys/dev/pci/if_jme.c      Thu Oct 17 21:06:15 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_jme.c,v 1.22 2013/03/30 03:21:05 christos Exp $     */
+/*     $NetBSD: if_jme.c,v 1.23 2013/10/17 21:06:15 christos Exp $     */
 
 /*
  * Copyright (c) 2008 Manuel Bouyer.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.22 2013/03/30 03:21:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.23 2013/10/17 21:06:15 christos Exp $");
 
 
 #include <sys/param.h>
@@ -1345,7 +1345,6 @@
 static int
 jme_encap(struct jme_softc *sc, struct mbuf **m_head)
 {
-       struct jme_desc *txd;
        struct jme_desc *desc;
        struct mbuf *m;
        struct m_tag *mtag;
@@ -1446,7 +1445,6 @@
        }
 
        prod = sc->jme_tx_prod;
-       txd = &sc->jme_txring[prod];
 
        error = bus_dmamap_load_mbuf(sc->jme_dmatag, sc->jme_txmbufm[prod],
            *m_head, BUS_DMA_NOWAIT | BUS_DMA_WRITE);
diff -r d6b7200f78d2 -r c0c814124c29 sys/dev/pci/ld_twa.c
--- a/sys/dev/pci/ld_twa.c      Thu Oct 17 21:05:41 2013 +0000
+++ b/sys/dev/pci/ld_twa.c      Thu Oct 17 21:06:15 2013 +0000
@@ -1,5 +1,5 @@
 /*     $wasabi: ld_twa.c,v 1.9 2006/02/14 18:44:37 jordanr Exp $       */
-/*     $NetBSD: ld_twa.c,v 1.15 2012/02/02 19:43:06 tls Exp $ */
+/*     $NetBSD: ld_twa.c,v 1.16 2013/10/17 21:06:15 christos Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld_twa.c,v 1.15 2012/02/02 19:43:06 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_twa.c,v 1.16 2013/10/17 21:06:15 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -200,11 +200,9 @@
        uint8_t status;
        struct buf *bp;
        struct ld_twa_softc *sc;
-       struct twa_softc *twa;
 
        bp = tr->bp;
        sc = (struct ld_twa_softc *)tr->tr_ld_sc;
-       twa = device_private(device_parent(sc->sc_ld.sc_dv));
 
        status = tr->tr_command->command.cmd_pkt_9k.status;
 
diff -r d6b7200f78d2 -r c0c814124c29 sys/dev/pci/mly.c
--- a/sys/dev/pci/mly.c Thu Oct 17 21:05:41 2013 +0000
+++ b/sys/dev/pci/mly.c Thu Oct 17 21:06:15 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mly.c,v 1.45 2012/10/27 17:18:35 chs Exp $     */
+/*     $NetBSD: mly.c,v 1.46 2013/10/17 21:06:15 christos Exp $        */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mly.c,v 1.45 2012/10/27 17:18:35 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mly.c,v 1.46 2013/10/17 21:06:15 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2081,7 +2081,7 @@
 static int
 mly_fwhandshake(struct mly_softc *mly)
 {
-       u_int8_t error, param0, param1;
+       u_int8_t error;
        int spinup;
 
        spinup = 0;
@@ -2107,8 +2107,8 @@
                        continue;
 
                error = mly_inb(mly, mly->mly_error_status) & ~MLY_MSG_EMPTY;
-               param0 = mly_inb(mly, mly->mly_cmd_mailbox);
-               param1 = mly_inb(mly, mly->mly_cmd_mailbox + 1);
+               (void)mly_inb(mly, mly->mly_cmd_mailbox);
+               (void)mly_inb(mly, mly->mly_cmd_mailbox + 1);
 
                switch (error) {
                case MLY_MSG_SPINUP:
diff -r d6b7200f78d2 -r c0c814124c29 sys/dev/pci/mpii.c
--- a/sys/dev/pci/mpii.c        Thu Oct 17 21:05:41 2013 +0000
+++ b/sys/dev/pci/mpii.c        Thu Oct 17 21:06:15 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mpii.c,v 1.3 2013/08/09 19:51:29 kardel Exp $ */
+/* $NetBSD: mpii.c,v 1.4 2013/10/17 21:06:15 christos Exp $ */
 /*     OpenBSD: mpii.c,v 1.51 2012/04/11 13:29:14 naddy Exp    */



Home | Main Index | Thread Index | Old Index